Jump to content

[SOLVED] Error help


Rother2005

Recommended Posts

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 54

is this because ive missed something? maybe a ; or curly brace }
[code]
<?php
include('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>';}
//27
else
//checks if user has input text
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");

//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());
//50
echo ("<meta http-equiv=\"Refresh\" content=\"2; URL=members.php\"/>Thank You! You will be redirected");}
?>
</body>
</html>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/32507-solved-error-help/
Share on other sites

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>';}
//27
else
//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?
Link to comment
https://forums.phpfreaks.com/topic/32507-solved-error-help/#findComment-151108
Share on other sites

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.
Link to comment
https://forums.phpfreaks.com/topic/32507-solved-error-help/#findComment-151110
Share on other sites

sorry dcro2 asked me a question i was just answering

query 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
Link to comment
https://forums.phpfreaks.com/topic/32507-solved-error-help/#findComment-151119
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.