I'm working on this very simple user authentication script. I'm getting a parse error on the line I bolded below in the script.
<html>
<head>
<title>Password Checking Script</title>
</head>
<body>
<?
function print_form() {
?>
<form action="check_password.php" method="POST">
<h3>Please Login</H3>
User Name: <input type="text" name="user_name"><br>
Password: <input type="password" name="password">
<input type="submit" name="submit" value="Login">
</form>
<?
}
if(isset($submit));
if(!$db = mysql_connect("localhost", "root")):
print("<h1>Can't connect to the DB!</h1>\n");
else:
mysql_select_db("mattdb", $db);
endif;
$sql = "select * from users where user_name = '$user_name'";
$result = mysql_query($sql);
$row_count = mysql_num_rows($result);
if ($row_count == 0):
?>
<H3>Wrong User Name! Try Again!</h3>
<?
print_form();
else:
$row = mysql_fetch_array($result);
if($password != $row["user_password"]):
?>
<h3>Incorrect Password: Try Again!</h3>
<?
print_fom();
else:
?>
<H3>Password Accepted!</h3>
<?
endif;
endif;
else:
print_form();
endif;
?>
</body>
</html>
Any idea?