I write login this error appear
idex.php
<html>
<form action='login.php' method='POST'>
<p>User Name: <input type='text' name='username'><br/>
Password: <input type='password' name='password'><br/></p>
<input type='submit' value='log in'>
</form>
</html>
login.php
<?php
session_start();
$username = $_POST['username'];
$password = $_POST['password'];
if($username&&$password)
{
$connect = mysql_connect("localhost","root","") or die ("couldn’t connect!");
mysql_select_db("phplogin") or die ("couldn’t find db");
$query = mysql_query("SELECT * FROM user WHERE username ='$username'");
$numrows = mysql_num_rows($query);
if ($numrows !=0)
{
//code to login
while ($row = mysql_fetch_array($query))
{
// to get value enter by user
$dbusername = $row['username'];
// go to complte this $dbpassword
$dbpassword = $row['password']; [COLOR="Red"]//here error[/COLOR] Notice: Undefined index: password in C:\\wamp\\www\\login\\login.php on line 26
}
//check to see if they match!
if ($username==$dbusername)
{
echo "You’re in!<a href='member.php'> click </a>here to enter the member page.";
$_SESSION['username']=$username;
}
else
echo "Incorrect password!";
}
else
die ("That user doesn’t exist");
}
else!
die("Please enter and username and apassword");
?>