The line before is: else { The line before that has a ';'.
You've not closed something. Like an echo("");
Give us an add like!
Heres my entire code.
PHP Code:<?php
if(!$_POST['this']){
echo("
Please use this form to register...<br>
<form method=\"POST\">
<table width=300><tr><td width=\"200\">Username:</td>
<td><input type=\"text\" name=\"username\"></td></tr>
<tr><td width=\"200\">Password:</td>
<td><input type=\"text\" name=\"password\"></td></tr>
<tr><td width=\"200\">Confirm Password:</td>
<td><input type=\"text\" name=\"cpassword\"></td></tr>
<tr><td width=\"200\">Email</td>
<td><input type=\"text\" name=\"email\"></td></tr>
<tr><td width=\"200\">Username:</td>
<td><input type=\"text\" name=\"username\"></td></tr><tr>
<tr><td width=\"200\">Age:</td>
<td><input type=\"text\" name=\"age\"></td></tr>
<tr><td width=\"200\"></td><td><input type=\"submit\" name=\"this\" value=\"register\"></td></tr></table>
</form>");}
else{
$username = $_POST['username'];
$password =$_POST['password'];
$password=md5($password);
$cpassword =$_POST['cpassword'];
$cpassword=md5($cpassword);
$age = $_POST['age'];
$email = $_POST['email'];
$cemail = $_POST['cemail'];
if($password != $cpassword){
echo("The Two passwords didnt match..."); exit;
}
if ($age <= 13) {{
echo("Your not old enough to join."); exit;
}
if($email != $cemail){
echo("The two emails didnt match..."); exit;
}
else {
echo("You have now singed up as <b>$username!</b> You can log in by clicking <a href='login.php'>here.</a>")
$query = mysql_query("INSERT INTO `system` (`username`, `password`, `age`) VALUES ('$username', '$password', '$age'");
echo("You have suscssfully registered $username");
}
}
?>
You forgot to put the ';' at the end of the echoPHP Code:<?php
if(!$_POST['this']){
echo("
Please use this form to register...<br>
<form method=\"POST\">
<table width=300><tr><td width=\"200\">Username:</td>
<td><input type=\"text\" name=\"username\"></td></tr>
<tr><td width=\"200\">Password:</td>
<td><input type=\"text\" name=\"password\"></td></tr>
<tr><td width=\"200\">Confirm Password:</td>
<td><input type=\"text\" name=\"cpassword\"></td></tr>
<tr><td width=\"200\">Email</td>
<td><input type=\"text\" name=\"email\"></td></tr>
<tr><td width=\"200\">Username:</td>
<td><input type=\"text\" name=\"username\"></td></tr><tr>
<tr><td width=\"200\">Age:</td>
<td><input type=\"text\" name=\"age\"></td></tr>
<tr><td width=\"200\"></td><td><input type=\"submit\" name=\"this\" value=\"register\"></td></tr></table>
</form>");}
else{
$username = $_POST['username'];
$password =$_POST['password'];
$password=md5($password);
$cpassword =$_POST['cpassword'];
$cpassword=md5($cpassword);
$age = $_POST['age'];
$email = $_POST['email'];
$cemail = $_POST['cemail'];
if($password != $cpassword){
echo("The Two passwords didnt match..."); exit;
}
if ($age <= 13) {{
echo("Your not old enough to join."); exit;
}
if($email != $cemail){
echo("The two emails didnt match..."); exit;
}
else {
echo("You have now singed up as <b>$username!</b> You can log in by clicking <a href='login.php'>here.</a>");
$query = mysql_query("INSERT INTO `system` (`username`, `password`, `age`) VALUES ('$username', '$password', '$age'");
echo("You have suscssfully registered $username");
}
}
?>
Give us an add like!
Want to hide these adverts? Register an account for free!