I am not able to login through the following code.
i am very new to PHP.
Error Displayed - Sorry, could not log you in. Wrong login information.
please help me in this regard
<?php session_start(); // dBase file include "data.php"; if ($_GET["op"] == "login") { if (!$_POST["username"] || !$_POST["password"]) { die("You need to provide a username and password."); } // Create query $q = "SELECT * FROM `Sheet1` " ."WHERE `username`='".$_POST["username"]."' " ."AND `password`=MD5('".$_POST["password"]."') " ."LIMIT 1"; // Run query $r = mysql_query($q); if ( $obj = mysql_fetch_object($r) ) { // Login good, create session variables $_SESSION["valid_id"] = $obj->id; $_SESSION["valid_user"] = $_POST["username"]; $_SESSION["valid_time"] = time(); // Redirect to member page Header("Location: members.php"); } else { // Login not successful die("Sorry, could not log you in. Wrong login information."); } } else { //If all went right the Web form appears and users can log in echo ""; echo "username:"; echo "password:
"; echo ""; echo ""; } ?>