You saved a dying man....
Thanks! I believe some code is a bit out of fashion, but right now all I want is to get it going. Later, I will look at ways of doing changes and making it safer. I expect you will need part of the code in the form, and information on the database.
login.php HTML document text
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title> New Document </title> <meta name="Generator" content="EditPlus"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> </head> <body> <?php$host="localhost"; // Host name $username="pintotou_camilo"; // Mysql username $password="*******"; // Mysql password $db_name="pintotou_agents"; // Database name $tbl_name="Agents"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB");// username and password sent from form $user=$_POST['username']; $password=$_POST['password']; // To protect MySQL injection (more detail about MySQL injection) //$username = stripslashes($username); //$password = stripslashes($password); //$username = mysql_real_escape_string($username); //$password = mysql_real_escape_string($password);$sql="SELECT * FROM $tbl_name WHERE user='$user' and password='$password'"; $result=mysql_query($sql);// Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $user and $password, table row must be 1 rowif($count==1){// Register $username, $password and redirect to file "login_success.php"session_register("user");session_register("password"); header("/Pinto/login_success.php"); } else { echo "Wrong Username or Password, or you have not registered yet.<br> Please, go back and either reenter your login details, or press the register button"; } ?> </body></html>