Parse error in PHP login form
- by user225269
I'm trying to have a login form in php. But my current code doesnt work.
Here is the form:
<form name="form1" method="post" action="loginverify.php">
<td><font size="3">Username:</td>
<td></td>
<td><input type="text" name="uname" value="" maxlength="15"/><br/></td>
<td><font size="3">Password:</td>
<td></td>
<td><input type="text" name="pword" value="" maxlength="15"/><br/></td>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="Submit" value="Login" /></td>
</form>
And the verify.php
<?php
session_start();
?>
<?php
$host="localhost";
$username="root";
$password="nitoryolai123$%^";
$db_name="login";
$tbl="users";
$connection=mysql_connect($host, $username, $password) or die("cannot connect");
mysql_select_db($db_name, $connection) or die("cannot select db");
$user=$_POST['uname']
$pass=$_POST['pword']
$sql="SELECT Username, Password from users where Username='$user' and Password='$pass'";
$result=mysql_query[$sql];
$count=mysql_num_rows($result);
if($count==1){
$SESSION['Username']=$user;
echo"<a href='searchmain.php'> CONTINUE</a>";
}
else{
echo"wrong username or password";
echo"<a href='loginform.php'>Back</a>";
}
?>
Is there something wrong with my code. I get this parse error at line 15, which is this:
$pass=$_POST['pword']
But when I try to remove it.It goes to line 16 or line 17 again. What do I do