quickstopman Posted May 17, 2007 Share Posted May 17, 2007 hi guys im currently working on a delete user page for the user it seems like it would work but for some odd reason i get this error Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting '}' in /home/pokebash/public_html/getmetola/deleteaccount.php on line 29 why exactly would i need a } on that line in the code <? include("config.php"); session_start(); ob_start(); 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 $_SESSION['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 -- Dustin Link to comment https://forums.phpfreaks.com/topic/51905-solved-odd-error/ Share on other sites More sharing options...
grlayouts Posted May 17, 2007 Share Posted May 17, 2007 <? include("config.php"); session_start(); ob_start(); 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 $_SESSION['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"); } ?> try that, Link to comment https://forums.phpfreaks.com/topic/51905-solved-odd-error/#findComment-255878 Share on other sites More sharing options...
quickstopman Posted May 17, 2007 Author Share Posted May 17, 2007 now i get this error Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting '}' in /home/pokebash/public_html/getmetola/deleteaccount.php on line 30 Link to comment https://forums.phpfreaks.com/topic/51905-solved-odd-error/#findComment-255881 Share on other sites More sharing options...
grlayouts Posted May 17, 2007 Share Posted May 17, 2007 thats before your echo your missing a ; cant see where though. Link to comment https://forums.phpfreaks.com/topic/51905-solved-odd-error/#findComment-255884 Share on other sites More sharing options...
per1os Posted May 17, 2007 Share Posted May 17, 2007 <?php echo "That you want to Delete "; // semicolon required here echo $_SESSION['username']; echo " ?"; // semicolon required here echo ' <form name="choice" method="POST" action="deleteaccount.php"> <input type="submit" value="Yes" name="yes"> <input type="submit" value="No" name="no"> </form> '; These are basic syntax errors, I would look up on the basic syntax of PHP before you go too much further. These are not "odd errors" they are fully legit and very helpful as they point out the offending line. Also a syntax highlighting program might help you with this also. Link to comment https://forums.phpfreaks.com/topic/51905-solved-odd-error/#findComment-255885 Share on other sites More sharing options...
quickstopman Posted May 17, 2007 Author Share Posted May 17, 2007 oh .. silly me sorry another stupid mistake by me Link to comment https://forums.phpfreaks.com/topic/51905-solved-odd-error/#findComment-255887 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.