quickstopman Posted May 22, 2007 Share Posted May 22, 2007 im trying to make a delete account script but nothing happens when you click the buttons i know its probly something simple but i need help <? include("config.php"); session_start(); ob_start(); $username = $_SESSION['username']; if (isset($_SESSION['username'])) { include("header.php"); $choice = $_POST['choice']; $yes = $_POST['yes']; $no = $_POST['no']; if ($choice) { if ($yes = "Yes") { mysql_query("DELETE FROM users WHERE id='{$_SESSION['id']}'") or die(mysql_error()); header("Refresh:2; url=logout.php"); echo " Your account has been Deleted"; } else if ($no = "No") { header("Location: editprofile.php"); } } else { echo "<h1> Are you sure??? </h1><br><br>"; echo "That you want to Delete "; echo $username ; echo "?"; echo '<form name="choice" method="POST" action="deleteaccount.php"> <input type="submit" value="Yes" name="yes"> <input type="submit" value="No" name="no"> </form>'; } } else { header("Location: default.html"); } ?> thanks guys! Quote Link to comment https://forums.phpfreaks.com/topic/52414-solved-delete-account-form/ Share on other sites More sharing options...
quickstopman Posted May 22, 2007 Author Share Posted May 22, 2007 nevermind.. again... :-\ :-\ :-\ Quote Link to comment https://forums.phpfreaks.com/topic/52414-solved-delete-account-form/#findComment-258663 Share on other sites More sharing options...
spode Posted May 22, 2007 Share Posted May 22, 2007 Just a quick thing I noticed. Towards the bottom where you say: echo "That you want to Delete "; echo $username ; echo "?"; It's unneccesary to use that many echo statements. Just use concentation. (I think is the word) : echo "That you want to Delete " . $username . "?"; Just for the sake of time and fingers! yay for noob post Quote Link to comment https://forums.phpfreaks.com/topic/52414-solved-delete-account-form/#findComment-258675 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.