Rother2005 Posted January 2, 2007 Share Posted January 2, 2007 hi peeps, my code keeps giving me the error Parse error: parse error, unexpected $end in C:\Program Files\xampp\htdocs\Loginpage.php on line 54is this because ive missed something? maybe a ; or curly brace }[code]<?phpinclude('connect1.inc');?><html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Booze Cruise Reg</title></head><body><?php if(!$_POST['register']){echo'<p align="center"><strong>Member Registration</strong></p><form name="form1" method="POST" action=""><p align="center">Username: <input type="text" name="username"></p><p align="center">Password: <input type="text" name="password"></p><p align="center">Firsname: <input type="text" name="firstname"></p><p align="center">Surname: <input type="text" name="surname"></p><p align="center">Address 1: <input type="text" name="address1"></p><p align="center">Address 2: <input type="text" name="address2"></p><p align="center">Town: <input type="text" name="town"></p><p align="center">County: <input type="text" name="county"></p><p align="center">Postcode: <input type="text" name="postcode"></p><p align="center">Tel No: <input type="text" name="telno"></p><p align="center">Mobile: <input type="text" name="mobile"></p><p align="center">Email: <input type="text" name="email"></p><p align="center"><input type="submit" name="register" value="Enter Details"></p></form>';} //27else//checks if user has input textif ($username=$_POST['username'] == "") { die ("No Username Input");if ($password=$_POST['password'] == "") { die ("No Password Input");if ($firstname=$_POST['firstname'] == ""){ die ("No Fristname Input");if ($surname=$_POST['surname'] == "") { die ("No Surname Input");if ($address1=$_POST['address1'] == "") { die ("No Address Input");if ($town=$_POST['town'] == "") { die ("No Town Input");if ($county=$_POST['county'] == "") { die ("No County Input");if ($postcode=$_POST['postcode'] == "") { die ("No Postcode Input");if ($email=$_POST['email'] == "") { die ("No Email Input");//encrypts password server side into md5 32bytes$password = stripslashes($password);$password = md5($password);$sql = "INSERT INTO member(Username,Password,Firstname,Surname,Address1,Address2,Town,County,Postcode,TelNo,Mobile,Email)VALUES ('$username','$password','$firstname','$surname','$address1','$address2','$town','$county','$postcode','$telno','$mobile','$email')";mysql_query($sql) or die(mysql_error());//50echo ("<meta http-equiv=\"Refresh\" content=\"2; URL=members.php\"/>Thank You! You will be redirected");}?></body></html>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/32507-solved-error-help/ Share on other sites More sharing options...
dcro2 Posted January 2, 2007 Share Posted January 2, 2007 You're missing a starting brace for [b]else[/b] here[code]<p align="center"><input type="submit" name="register" value="Enter Details"></p></form>';}//27else//checks if user has input text[/code]and then you're missing a ending brace for each of these[code]if ($username=$_POST['username'] == "") { die ("No Username Input");if ($password=$_POST['password'] == "") { die ("No Password Input");if ($firstname=$_POST['firstname'] == ""){ die ("No Fristname Input");if ($surname=$_POST['surname'] == "") { die ("No Surname Input");if ($address1=$_POST['address1'] == "") { die ("No Address Input");if ($town=$_POST['town'] == "") { die ("No Town Input");if ($county=$_POST['county'] == "") { die ("No County Input");if ($postcode=$_POST['postcode'] == "") { die ("No Postcode Input");if ($email=$_POST['email'] == "") { die ("No Email Input");[/code]What happened to your previous topic? Quote Link to comment https://forums.phpfreaks.com/topic/32507-solved-error-help/#findComment-151108 Share on other sites More sharing options...
trq Posted January 2, 2007 Share Posted January 2, 2007 It helps if you put your code in the forums [ code ] [ / code ] tags (without the spaces) so that syntax highlighting is activated, this will point out allot of syntax errors.You might also try formatting your code like most good programmers do, and indent your code in logical blocks. This, once again makes syntax errors easier to spot as well as making your code easier to read.Finally, when posting an error it helps to point out the line in question.I think I can see a few to many ) and }, but if you straightened your code out it would be much easier. Quote Link to comment https://forums.phpfreaks.com/topic/32507-solved-error-help/#findComment-151110 Share on other sites More sharing options...
Rother2005 Posted January 2, 2007 Author Share Posted January 2, 2007 im just getting this to work then il be able to test the issue raise in the other topic Quote Link to comment https://forums.phpfreaks.com/topic/32507-solved-error-help/#findComment-151113 Share on other sites More sharing options...
trq Posted January 2, 2007 Share Posted January 2, 2007 [quote]im just getting this to work then il be able to test the issue raise in the other topic[/quote]What does that meen? Quote Link to comment https://forums.phpfreaks.com/topic/32507-solved-error-help/#findComment-151115 Share on other sites More sharing options...
Rother2005 Posted January 2, 2007 Author Share Posted January 2, 2007 sorry dcro2 asked me a question i was just answeringquery solved thanks for the help peeps many thanks is there a donate feature to this site as its been such a help?also thorpe sorry if ive been posting wrong but ive made note and will hopefully do it right from now on Quote Link to comment https://forums.phpfreaks.com/topic/32507-solved-error-help/#findComment-151119 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.