c172cpt Posted August 5, 2007 Share Posted August 5, 2007 I have been working debugging a site for quite some time and i have a parse error in this function that i cant solve. in a nutshell the function recieves post data then verifys that data was sent from user and then the part with the error is an if/then statement that is supposed to determine if no new username was entered => change the mysql command approapiatly else check that the current username is not the same and the new => error out otherwise change the mysql command to include the new username then display status output here is the code can any one please help find the error //******************************** if (!isset($newuname){ $updatelogin = "update users set password=md5('$password'), question='$question', answer='$answer' where username='$uname'" }else{ if ($currentuname == $newuname){ error("Your New Username Cannot Be The Same As The Old Username"); //update with the username }else{ $updatelogin = "update ignore users set username='$newuname', password=md5('$password'), question='$question', answer='$answer' where username='$uname'" }} $status = getemsql($updatelogin, 'accounts'); if (!$status}{ error("An Error Has Occured Please Try Again."); }else{ status("Login Information Updated, Please Logout and Login to Finish Update"); } //************************* btw the error function is a js popup that goes back to form and the status function is the same popup that does not go back thanks in advance -scott- Link to comment https://forums.phpfreaks.com/topic/63450-parse-error/ Share on other sites More sharing options...
Barand Posted August 5, 2007 Share Posted August 5, 2007 if (!isset($newuname)) { /// you had missing ")" You have missing ";" at ends of lines. and if (!$status} { /// should be a ")" Link to comment https://forums.phpfreaks.com/topic/63450-parse-error/#findComment-316193 Share on other sites More sharing options...
c172cpt Posted August 5, 2007 Author Share Posted August 5, 2007 thank you i cant believe i did not see that that fixed it now i can move through the rest of the page -scott- Link to comment https://forums.phpfreaks.com/topic/63450-parse-error/#findComment-316197 Share on other sites More sharing options...
Barand Posted August 5, 2007 Share Posted August 5, 2007 See edited post ; more errors found Link to comment https://forums.phpfreaks.com/topic/63450-parse-error/#findComment-316200 Share on other sites More sharing options...
c172cpt Posted August 5, 2007 Author Share Posted August 5, 2007 after that first error i saw the other errors and now the page works, i wrote this page while on a trip and didnt have internet access to test the code so i wrote out about 1000 lines with out debugging...i learned my lesson thanks, -scott- Link to comment https://forums.phpfreaks.com/topic/63450-parse-error/#findComment-316207 Share on other sites More sharing options...
Fadion Posted August 5, 2007 Share Posted August 5, 2007 You could easily install a xAMP system on your local pc or laptop and test your scripts without having to upload on a web server. Link to comment https://forums.phpfreaks.com/topic/63450-parse-error/#findComment-316236 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.