|
Posted by Sheik Ishmael on 06/04/07 10:29
Hi, I'm trying to get password recognition calling data froma table
called users('user_name' and 'user_password' using the below (bottom
of page) code.
However, I get the following warning from my browser
"Parse error: parse error, unexpected ';' in /data/members/paid/g/l/
glastonburytv.eu/htdocs/www/check_password.php3 on line 19
This is the line I have replaced my password with "MY PASSWORD"
Now I'm using the same connectivity activater (see line below) in
other pages
mysql_connect("localhost", "glastonburytv_eu", "MYPASSWORD")
Does anyone please have any ideas why I'm getting the error message on
the ";" (line 19)
(Full Code Below)
Thank You
--Sheik Ishmael
<html>
<head>
<title>Password Checking Script</title>
</head>
<body>
<?php
function print_form() {
?>
<form action="check_password.php3" 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", "glastonburytv_eu",
"MYPASSWORD"));
print("<h1>Can't Connect to the DB!</h1>\n");
else:
mysql_select_db("glastonburytv_eu_1");
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_form();
else:
?>
<h3>Password Accepted!</h3>
<?
endif;
endif;
else:
print_form();
endif;
?>
</body>
</html>
Navigation:
[Reply to this message]
|