I am currently stocked :( basically I am doing a login page There is no problem with the login page but once i submit it... this is my code for my login page.
<form action= "process.php" method="POST">
Username: <input type="text" id="user" name="username">
Password: <input type="password" id="pass" name="password">
<input type="submit" value="Submit" >
now my process.php however is making the same error..I cant seem to find the problem. Please Help Here is the code
<?php
$username = $_POST['user'];
$password = $_POST['pass'];
//to prevent sql injection
$username = stripcslashes($username);
$password = stripcslashes($password);
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string ($password);
//connect to the server and select database
mysql_connect("localhost","root","");
mysql_select_db("franklin offshore");
//query the database for user
$result = mysql_query("select * from login where username='$username'
and password='$password'")
or die ("Failed to query database ".mysql_error());
$row = mysql_fetch_array($result);
if ($row['username'] == $username && $row['password'] == $password)
{
echo "LOGIN SUCCESS WELCOME" .$row['username'];
}
else
{
echo "Failed to LOGIN" ;
}
?>
This is what it keeps showing
Fatal error: Uncaught Error: Call to undefined function mysql_real_escape_string()
Please help