Jambuster Posted August 22, 2010 Share Posted August 22, 2010 Hey, I made a register page and its all working great. I want to have a "Back" button when the user submits the form if password1 & password2 do not match or username allready exists. But trying to put one in after the echo command isn't working for me. Can anyone help? Heres the error I recieve: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/jamiew90/public_html/Staff/register.php on line 49 Heres line 49 & the surrounding lines incase needed, line 49 is the one beginning with echo: //none were left blank! We continue... if($password != $cpassword) { // the passwords are not the same! echo "<br><br><b>Passwords do not match</b> <p> <FORM><INPUT TYPE="button" VALUE="Back" onClick="history.go(-1);return true;;"> </FORM>";"; }else{ // the passwords are the same! we continue... Is it possible to even add a back button after echo? Thanks for the help - Jamie Quote Link to comment https://forums.phpfreaks.com/topic/211435-error-after-echo-on-back-button/ Share on other sites More sharing options...
premiso Posted August 22, 2010 Share Posted August 22, 2010 If you look at the syntax highlight you will see that you have double quotes inside of double quotes. This is syntax basics, which I would suggest you to look up. echo '<br><br><b>Passwords do not match</b> <p> <INPUT TYPE="button" VALUE="Back" onClick="history.go(-1);return true;">'; You do not need the form tags for an input tag to work. You only need the form tags if you want to pass POST or GET data to the page, in this case you are trying to do neither. But making the echo's quotes the single quotes this should display and work correctly. As stated you should look into syntax and namely the quotes and how to properly use them to understand this. Quote Link to comment https://forums.phpfreaks.com/topic/211435-error-after-echo-on-back-button/#findComment-1102411 Share on other sites More sharing options...
Jambuster Posted August 22, 2010 Author Share Posted August 22, 2010 Thanks premiso that solved the problem for me. I will look into it some more & learn about it, - Jamie Quote Link to comment https://forums.phpfreaks.com/topic/211435-error-after-echo-on-back-button/#findComment-1102429 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.