I get the following error now:
Warning: unlink(/members/images/) [function.unlink]: Operation not permitted in /members/delete.php on line 19
Also is echos
$msg = "You have successfully deleted your vehicles image. Please go back and upload a new image at this time.";
No matter what I try. What am I doing wrong???
Here is the script now:
// *** Start the session
session_start();
$username = $_SESSION['username'];
$msg = "";
$dir = "/members/images";
//delete existing image.
if(isset($_POST['sent'])) {
if (isset($_POST['delete'])){
$result = mysql_query("SELECT vimage FROM membersrigs WHERE username = '$username'");
$vimage = mysql_fetch_assoc($result);
$deletevimage = $vimage['vimage'];
$locvimage = "/members/images/$deletevimage";
unlink($locvimage);
$result = mysql_query("UPDATE membersrigs SET vimage = null WHERE username = '$username'");
$msg = "You have successfully deleted your vehicles image. Please go back and upload a new image at this time.";
} else if ( '' == $vimage['vimage']) {
$msg = "There is no image to delete, please go back and upload your image.";
}
}
I even tried it with out my if( '' == $vimage['vimage']) statement and just used the else clause. Still same thing happens.