Quote:
|
Originally Posted by Saharika
problem1)
the user name and password are stored in database table ..the user enter username and password and it is checked against the password and username in tables
now problem is if uname and pass are correct i want user to direct to thier personal profile page...if user can see only his personal profile
|
Tip 1: Dont store your passwords in the database in plain text. Use some kind of hashing algorithm to make it secure. Use PHP's
md5($string_variable); to generate MD5 hash and save that in the database instead.
As for your query,
Let's say you have a homepage as
home.php then you can do something like this.
Code:
if ($username == $database_username && $passwd == $database_passwd)
{
header('Location: home.php');
exit();
}
else
{
header('Location: login.php');
exit();
}