T_IF error in php registration form -
i trying php registration form working, having problems if/else statement. can't quite figure out.
error: parse error: syntax error, unexpected 'if' (t_if) in e:\xampp\htdocs\test\register.php on line 21 php code :
$username = $_post['username']; $password = $_post['password']; $repassword = $_post['repassword']; $email = $_post['email']; if ($username && $password && $repassword && $email) { if ($password == $repassword) { include ("connect.php"); $query = mysql_query("select * users username = '$username'"); $numrows = mysql_num_rows($query) if($numrows == 0) <<- line 21 { echo "username not taken"; } else { echo "that username taken!"; } } else echo "password did not match"; } else echo "you did not fill in every field!"; else {//show registration form stackoverflow cant display properly.} maby 1 of guys sees problem.
thanxs in advance,
jim
you missing semicolon ; right after query
$numrows = mysql_num_rows($query); //here missing wich causing error edit kavi siegel suggested seems missing closing bracket in last else (the 1 have commented)
else {//show registration form stackoverflow cant display properly. } //this commented
Comments
Post a Comment