What is my mistake in this PHP code? Parse error: syntax error...?

tim

New member
My error message is: ( ! ) Parse error: syntax error, unexpected $end in C:\wamp\www\website\register.php on line 98

So you don't waste your time, my error seems to have something to do with the if statements (not certain though). The line is currently 98, but it keeps changing after I modify the code a bit. It was around 30 before and had something to do with brackets or echo statements. Also, when I copy-paste the code and submit this question, part of $repeatpassword) doesn't show at one point, but don't worry about that.

Thank you very much!

The code is:

<?php
echo "<h1>Register</h1>";
$submit = $_POST['submit'];
$fullname = strip_tags($_POST['fullname']);
$username = strip_tags($_POST['username']);
$password = strip_tags($_POST['password']);
$repeatpassword = strip_tags($_POST['repeatpassword']);
$date = date("Y-m-d");

if ($submit)
{

if ($fullname&&$username&&$password&&$repeatpassword)
{
$password = md5($password);
$repeatpassword = md5($repeatpassword);

if ($password==$repeatpassword)
{

if (strlen($username)>25||strlen($fullname)>25)

{
echo "Length of username of fullname is too long!";
}

else

{
if (strlen($password)>25||strlen($password)<6)
{
echo "Password must be between 6 and 25 characters";

}

else
{

echo "Success!!";
}
}



}
else echo "Your password do not match";

}
else echo "Please fill in all fields!";
?>

<html>
<p>
<form action='register.php' method='POST'>
<table>
<tr>
<td>
Your full name:
</td>
<td>
<input type='text' name='fullname'>
</td>
</tr>
<tr>
<td>
Choose a username:
</td>
<td>
<input type='text' name='username'>
</td>
</tr><tr>
<td>
Choose a password:
</td>
<td>
<input type='password' name='password'>
</td>
</tr>
<tr>
<td>
Repeat your password:
</td>
<td>
<input type='password' name='repeatpassword'>
</td>
</tr>
</table>

<p>
<input type='submit' name='submit' value='Register'>
</form>
</html>
Sorry it posts without indents :/
 
Back
Top