Answers
Aug 26, 2008 - 10:56 PM
// this is for login verification page
session_start(); // start session here
include "connection.php"; // connection file include for database
$username=$_REQUEST['username']; // username pass from username textbox
$password=$_REQUEST['password']; //password pass from password textbox
$sql="select * from tablename where username='$username' and password='$password'"; // query from registration table where user data is available
$result=mysql_query($sql);
mysql_num_rows($result);
if(mysql_num_rows($result)>0)
{
$row=mysql_fetch_array($result);
$_SESSION['id']=$row['id'];
echo "!"; // redirect the browser after successful login
}
else
{
echo "!"; // redirect the browser after invliad login or password insert
}
// end of the login verification page
// start of the each and every page you have to put up following information
session_start(); // start the session
$id=$_SESSION['id']; // this will carry the particular user's id
?>
Aug 27, 2008 - 10:43 AM
Would you like to login into my web site server and have a look what is wrong. If yes, please send me an email or post your email address here, I will give you the username and password. Thanks,
My email: gloriabai@yahoo.com
Sincerely,
Gloria
Oct 24, 2009 - 11:17 AM
Plz try to use following code after horizontal line,
if(mysql_num_rows($result)>0)
{
$row=mysql_fetch_array($result);
session_register("id"); // shashi u have to add this line to pass session value, how can u register without telling to it?
$_SESSION['id']=$row['id'];
header("location:success.php"); //if php already granted u "header" command why u use script?
}
else
{
echo "!"; // redirect the browser after invliad login or password insert
}
Nov 27, 2009 - 05:15 AM
The Quomon Team
Add New Comment