Jump to content

unlink() problems


meltingpoint

Recommended Posts

Below is my exact code.  I can get the unlink() to work in other scripts- but not this one.

Anyone see anything that would make unlink() not work?

 

$file1, $file2 etc...are defined in the config file as exampled above.

//
switch($database)
{
case "maindb": $filetorestore = 'databases/BACKUPmaindatadb.txt' and $restored = $file2;
						break;
case "homedb": $filetorestore = 'databases/BACKUPdchomedb.txt' and $restored = $file3;
						break;
case "petsdb": $filetorestore = 'databases/BACKUPlostanimals.txt' and $restored = $file8;
						break;
case "vehiclesdb": $filetorestore = 'databases/BACKUPvehicleslist.txt' and $restored = $file11;
						break;
case "bikesdb": $filetorestore = 'databases/BACKUPbikelist.txt' and $restored = $file7;
						break;
case "licensesdb": $filetorestore = 'databases/BACKUPbikelicenses.txt' and $restored = $file12;
						break;
case "parkingdb": $filetorestore = 'databases/BACKUPparkingpermission.txt' and $restored = $file9;
						break;
case "dispatchnotesdb": $filetorestore = 'databases/BACKUPdispatchnotes.txt' and $restored = $file6;
						break;
case "usersdb": $filetorestore = 'databases/BACKUPuserpermissions.txt' and $restored = $file10;
						break;
case "categoriesdb": $filetorestore = 'databases/BACKUPcategories.txt' and $restored = $file5;
						break;
case "spcattndb": $filetorestore = 'databases/BACKUPspcattndatabase.txt' and $restored = $file13;
						break;
default: $filetorestore = $file100;
						break;
}
//
if(empty($filetorestore)){
$message = "<center>ERROR!- no database was selected/detected to be Backed-UP.  Please try again.  If problem persists- notify the Web/IT Administrator.</center>";
include("dcloginmessagepage.php");
exit;
}
//
sleep(1);//---------------supposed fix for IIS Servers that copy() does not work well with------------
//
if(!copy($filetorestore, $restored))
{
$message = "<center>The RESTORATION of the Database was UNSUCCESSFUL!- Please notify the Administrator.</center>";
include("dcloginmessagepage.php");
exit;
}
else
{
$message = "<center>RESTORATION of the Database was sucessfull.</center>";
include("dcloginmessagepage.php");
exit;
}
//
unlink($filetostore);
//
//
//-----------------------------------------------------------------------------------------------------------------------------

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.