[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Webmasterplein.net • Toon onderwerp - rmdir, het werkt niet.
Pagina 1 van 1

rmdir, het werkt niet.

BerichtGeplaatst: 24 jul 2006 20:50
door Remi
Ik ben al een uurtje beaig met dit probleem op telossen maar het wil maar niet lukken. mss zien jullie het probleem:
[code="php"]<?php
if($_POST['send'] == 'yes') {
if($_POST['check'] != 'yes') {
$error = 'You need to check the checkbox' ;
}
if(empty($error)) {
$done = rmdir('../../cat/'.$_POST['name']) ;
if($done != false) {
$error = 'Category succesful deleted' ;
}
else {
$error = 'Failed to delete '.$_POST['name'] ;
}
}
}
?>
<div align="center">
<table width="500" border="0" cellspacing="0">
<tr>
<td height="25" colspan="3" bgcolor="#003366"><div align="center" class="style12">New categroy </div></td>
</tr>
<tr>
<td width="20" rowspan="2" bgcolor="#003366">&nbsp;</td>
<td height="50"><div align="center" class="style13">
<form name="form1" method="post" action="category.php?action=delete">
<table width="400" border="0">
<tr>
<td colspan="2"><?php echo $error ?></td>
</tr>
<tr>
<td width="100">Name</td>
<td><select name="name">
<?php
if ($dir = opendir('../../cat/'))
{
while (false !== ($file = readdir($dir)))
{
if ($file != "." && $file != ".." && $file != ".htacces" && $file != "index.php")
{
$filename = explode('.',$file);
echo '<option value="'.$filename[0].'">'.$filename[0].'</option>';
}
}
closedir($dir);
}
?>
</select>
</td>
</tr>
<tr>
<td colspan="2"><input name="check" type="checkbox" id="check" value="yes" />
I know sure, that I want te delete the catogory, with in all the files/photos. </td>
</tr>
<tr>
<td><input name="send" type="hidden" id="send" value="yes"></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="submit" name="Submit" value="Delete Category"></td>
</tr>
</table>
</form>
</div> <div align="center" class="style13"></div></td>
<td width="20" rowspan="2" bgcolor="#003366">&nbsp;</td>
</tr>

<tr>
<td bgcolor="#003366">&nbsp;</td>
</tr>
</table>
<p></p>
<div align="center"></div>
</div>[/code]

Re: rmdir, het werkt niet.

BerichtGeplaatst: 24 jul 2006 20:52
door Remi
Ik heb probleem al gevonden, de hele map moet namelijk leeg zijn.
Maar weet iemand hoe je de hele map kan legen.

Re: rmdir, het werkt niet.

BerichtGeplaatst: 24 jul 2006 21:27
door LinkinTED
De dir uitlezen en de bestanden verwijderen. (readdir)

Re: rmdir, het werkt niet.

BerichtGeplaatst: 25 jul 2006 11:46
door Remi
Heb nu dit om de directory leeg te maken, maar het wil niet werken.
[code="php"]<?php
if($_POST['send'] == 'yes') {
if($_POST['check'] != 'yes') {
$error = 'You need to check the checkbox' ;
}
if(empty($error)) {

if ($dir = opendir('../../cat/'.$_POST['name'].'/'))
{
while (false !== ($file = readdir($dir)))
{
if ($file != "." && $file != ".." && $file != ".htacces" && $file != "index.php")
{
$done = unlink('../../cat/'.$_POST['name'].'/'.$file) ;
}
}
closedir($dir);
}
//rmdir('../../cat/'.$_POST['name']) ;
if($done != false) {
$error = 'Category succesful deleted' ;
}
else {
$error = 'Failed to delete '.$_POST['name'] ;
}
}
}
?>
<div align="center">
<table width="500" border="0" cellspacing="0">
<tr>
<td height="25" colspan="3" bgcolor="#003366"><div align="center" class="style12">New categroy </div></td>
</tr>
<tr>
<td width="20" rowspan="2" bgcolor="#003366">&nbsp;</td>
<td height="50"><div align="center" class="style13">
<form name="form1" method="post" action="category.php?action=delete">
<table width="400" border="0">
<tr>
<td colspan="2"><?php echo $error ?></td>
</tr>
<tr>
<td width="100">Name</td>
<td><select name="name">
<?php
if ($dir = opendir('../../cat/'))
{
while (false !== ($file = readdir($dir)))
{
if ($file != "." && $file != ".." && $file != ".htacces" && $file != "index.php")
{
$filename = explode('.',$file);
echo '<option value="'.$filename[0].'">'.$filename[0].'</option>';
}
}
closedir($dir);
}
?>
</select>
</td>
</tr>
<tr>
<td colspan="2"><input name="check" type="checkbox" id="check" value="yes" />
I know sure, that I want te delete the catogory, with in all the files/photos. </td>
</tr>
<tr>
<td><input name="send" type="hidden" id="send" value="yes"></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="submit" name="Submit" value="Delete Category"></td>
</tr>
</table>
</form>
</div> <div align="center" class="style13"></div></td>
<td width="20" rowspan="2" bgcolor="#003366">&nbsp;</td>
</tr>

<tr>
<td bgcolor="#003366">&nbsp;</td>
</tr>
</table>
<p></p>
<div align="center"></div>
</div>[/code]