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"> </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> </td>
</tr>
<tr>
<td> </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"> </td>
</tr>
<tr>
<td bgcolor="#003366"> </td>
</tr>
</table>
<p></p>
<div align="center"></div>
</div>[/code]