Now, i am trying to make it so that when i click the button, it renames the "forum" folder to something like "forum_8u40350d" and then the "forum_lockdown" to just "forum", so now instead of the forum is a page i created with info on. THen if i click the button again it will undo those changes and put the forum back. But my script wont work, it will only go one way - putting the forum into "lockdown" mode and it wont go back.
Code: Select all
<?php
$status=include('D:/inetpub/www-xxxxx.com/lockdown_status.php');
if ( $status = 'off' ) {
rename("D:\inetpub\www-xxxxx.com\forum", "D:\inetpub\www-xxxxxx.com\forum_ld_975j230f70");
rename("D:\inetpub\www-xxxxx.com\forum_lockdown", "D:\inetpub\www-xxxxx.com\forum");
$myFile = ('D:/inetpub/www-xxxxx.com/lockdown_status.php');
$fh = fopen($myFile, 'w') or die("can't open file");
fwrite($fh, "on");
fclose($fh);
} else {
rename("D:\inetpub\www-xxxxx.com\forum", "D:\inetpub\www-xxxxx.com\forum_lockdown");
rename("D:\inetpub\www-xxxxx.com\forum_ld_975j230f70", "D:\inetpub\www-xxxxx.com\forum");
$myFile = ('D:/inetpub/www-xxxxx.com/lockdown_status.php');
$fh = fopen($myFile, 'w') or die("can't open file");
fwrite($fh, "off");
fclose($fh);
}
?>the file "lockdown_status.php" does exist and has the work "off" in it currently.
anyone know whats wrong?