I have a form that, when submitted, will delete a users profile by processing deleteuser.php
.
<form method='post' action='deleteuser.php'>
<input type='submit' name='delete' value='Delete Profile'>
And here is the deleteuser.php
session_start();
include("config.php");
if(isset($_POST['submit'])){
$id = $_SESSION['uid'];
$sql = "DELETE from users WHERE id='$id'";
mysql_query($sql) or die(mysql_error());
echo "User has been sucessfully deleted!";
}
else{
echo "ERROR: User was not deleted";
}
Now I am only getting "User was not deleted".
Any idea why?