| | |
why isnt this working?
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Apr 2009
Posts: 281
Reputation:
Solved Threads: 2
PHP Syntax (Toggle Plain Text)
<?php $documentroot = $_SERVER['DOCUMENT_ROOT']; $username = "Administrator"; $dir = $documentroot . '/' . $username; function rmdir_r ( $dir, $DeleteMe = TRUE ) { if ( ! $dh = @opendir ( $dir ) ) return; while ( false !== ( $obj = readdir ( $dh ) ) ) { if ( $obj == '.' || $obj == '..') continue; if ( ! @unlink ( $dir . '/' . $obj ) ) rmdir_r ( $dir . '/' . $obj, true ); } closedir ( $dh ); if ( $DeleteMe ) { @rmdir ( $dir ); } } ?>
it supposed to delete all files int eh directory and delete tehd riectory but its not doing anything!!!!!!
1
#2 30 Days Ago
Try adding the following line to your script, anywhere after the line
Basically, the code inside the function doesn't execute until the function is called.
$dir = $documentroot . '/' . $username; but not inside the function: php Syntax (Toggle Plain Text)
rmdir_r($dir);
Last edited by darkagn; 30 Days Ago at 9:43 am.
There are no stupid questions, only those too stupid to ask for help.
echo is a web developer's best friend. ![]() |
Similar Threads
- VERY complicated IF statement isnt working! :O( (PHP)
- My IF ($email_settings == "0") isnt working! :( (PHP)
- why isnt it working!?! (C++)
- my html code isnt working please help (JavaScript / DHTML / AJAX)
- msn messenger 7.0 isnt working (Windows 95 / 98 / Me)
- Sound Card isnt working! (PCI and Add-In Cards)
- HELP -my Date code isnt working (ASP)
- CD-ROm isnt working correctly (Storage)
Other Threads in the PHP Forum
- Previous Thread: Automatically create pages from files in directory
- Next Thread: block js injections through php
| Thread Tools | Search this Thread |
advanced alerts apache api archive array autosuggest beginner binary broken cakephp checkbox class clients cms code cron curl database date datepart display dynamic echo email emptydisplayvalue eregi error execute explodefunction file files folder form forms function functions google hack head href htaccess html if...loop image include insert ip javasciptvalidation javascript joomla keywords library limit link login mail matching menu mlm multiple mysql object oop password paypal pdf php phpincludeissue query radio random recursion recursive remote script search searchbox server sessions shot smarty source space speed sql syntax system table tutorial update upload url validator variable vbulletin video web website youtube





