login script using cookies. page does't redirect
Posted: Mon Mar 14, 2011 2:48 am
Hi all,
I am a beginner PHP programmer. when i click on login button. it pass the url "http://localhost/mylibrary/index.php?co ... login=true" instead of redirect to Home.php
config file is included..to conn with mysql. & store pwd in MD5.
1. login form.
<form name="login_form" action="<?php echo $PHP_SELF; ?>?cookie_set=true&login=true" method="post">
2.Index.php
if ($cookie_set==true)
{
if ($login==true)
{
// Making sure the form is not blank
if ($username==true && $password==true)
{
// Setting login cookie
// Encripting the password with MD5
$password = MD5($password);
setcookie("MyLibrary[username]", $username);
setcookie("MyLibrary[password]", $password);
header ("Location: $PHP_SELF?module=home");
exit;
}
plz help me.
I am a beginner PHP programmer. when i click on login button. it pass the url "http://localhost/mylibrary/index.php?co ... login=true" instead of redirect to Home.php
config file is included..to conn with mysql. & store pwd in MD5.
1. login form.
<form name="login_form" action="<?php echo $PHP_SELF; ?>?cookie_set=true&login=true" method="post">
2.Index.php
if ($cookie_set==true)
{
if ($login==true)
{
// Making sure the form is not blank
if ($username==true && $password==true)
{
// Setting login cookie
// Encripting the password with MD5
$password = MD5($password);
setcookie("MyLibrary[username]", $username);
setcookie("MyLibrary[password]", $password);
header ("Location: $PHP_SELF?module=home");
exit;
}
plz help me.