[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.
aan alle goede dingen komt een eind, webmasterplein.net 2003 - 2013
wij danken jullie voor al mooie momenten die dankzij dit forum ontstonden - Derk, Rutger en Stef

rmdir, het werkt niet.

Je komt er niet helemaal uit bij het scripten? Übergoede functie geschreven? Alles met betrekking tot scripting, kun je hier terecht.

rmdir, het werkt niet.

Berichtdoor Remi » 24 jul 2006 20:50

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]
Avatar gebruiker
Remi
wmpr
 
Berichten: 3010
Geregistreerd: 04 apr 2006 15:22

Re: rmdir, het werkt niet.

Berichtdoor Remi » 24 jul 2006 20:52

Ik heb probleem al gevonden, de hele map moet namelijk leeg zijn.
Maar weet iemand hoe je de hele map kan legen.
Avatar gebruiker
Remi
wmpr
 
Berichten: 3010
Geregistreerd: 04 apr 2006 15:22

Re: rmdir, het werkt niet.

Berichtdoor LinkinTED » 24 jul 2006 21:27

De dir uitlezen en de bestanden verwijderen. (readdir)
Slicer nodig? ( xHTML | CSS | Semantische opbouw | Div )
http://www.iSlice.nl/
Avatar gebruiker
LinkinTED
wmpr
 
Berichten: 131
Geregistreerd: 14 jan 2006 16:47

Re: rmdir, het werkt niet.

Berichtdoor Remi » 25 jul 2006 11:46

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]
Avatar gebruiker
Remi
wmpr
 
Berichten: 3010
Geregistreerd: 04 apr 2006 15:22


Keer terug naar PHP, ASP, SQL



cron