Benden
maging ang maganda mamatay
Well Im doing the register page, and another error.
Error message: Parse error: syntax error, unexpected T_ELSE in C:\xampp\htdocs\zelo\register.php on line 45
Line 45:
Full code: ( I havent finished it because it broke D
I would love to try to fix myself but im still learning and i dont know what T_ELSE means
Error message: Parse error: syntax error, unexpected T_ELSE in C:\xampp\htdocs\zelo\register.php on line 45
Line 45:
PHP:
else
Full code: ( I havent finished it because it broke D
PHP:
<?php
echo "<h1> Register</h1>";
//form data
$submit = $_POST['submit'];
$username = strip_tags($_POST['name']);
$password = strip_tags($_POST['password']);
$repeatpassword = strip_tags($_POST['repeatpassword']);
$date = date ("Y-m-d");
if ($submit)
{
//check for existance
if($username&&$password&&repeatpassword)
{
//encrypt password
$password = md5($password);
$repeatpassword = md5($repeatpassword);
if ($password==$repeatpassword)
{
//check username length
if (strlen($username)>25)
{
echo "Length of username is too long";
}
else
{
//check password length
if (strlen($password)>15||strlen($password)<6)
{
echo "Password must be between 6 and 5 characters long!";
}
else
{
//register the user
echo "You've succefully registerd!";
}
}
else
echo "Your passwords do not match";
}
else
echo "Please fill in <b>all</b> fields!";
}
?>
<P>
<html>
<form action'register.php' method='POST'>
<table>
<tr>
<td>
Username:
</td>
<td>
<input type='text' name='name'>
</td>
</tr>
<tr>
<td>
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>
I would love to try to fix myself but im still learning and i dont know what T_ELSE means