Jump to content

mwaleedgul

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Everything posted by mwaleedgul

  1. Please help me I have exhausted now to find out the solution for this. I am new and learning php. I am facing this error. ( ! ) Notice: Undefined index: password in C:\wamp\www\login.php on line 7 Call Stack # Time Memory Function Location 1 0.0015 374152 {main}( ) ..\login.php:0 Please enter the username and password ............................................................... My Form code is...... <html> <form action="login.php" method="POST"> <p><input type="text" name="username"></p> <p><input type="password" name="passsword"></p> <p><input type="submit" name="submit" value="login"></p> </form> </html> and my login.php code is..... <?php session_start(); $username=$_POST['username']; $password=$_POST['password']; if ($username&&$password) { $connect = mysql_connect('localhost','root','') or die ("Couldn't connect to database"); mysql_select_db("alaqsatr_2374") or die ("Couldn't find database"); $query = mysql_query("SELECT * FROM users WHERE username='$username'"); $numrows = mysql_num_rows($query); if($numrows !=0) { while ($row = mysql_fetch_assoc($query)) { $dbusername = $row['username']; $dbpassword = $row['password']; } if ($username==$dbusername&&$password==$dbpassword) { echo "Login successful. <a href='membersarea.php'> Click here to enter the members area"; $_SESSION['username']=$dbusername; } else echo "Incorrect password"; } else die("That username doesn't exist."); } else die("Please enter the username and password"); ?> Please reply me my email is mwaleedgul@yahoo.com . many thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.