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.
login script using cookies. page does't redirect
Moderator: General Moderators
login script using cookies. page does't redirect
- Attachments
-
- MyLibrary.zip
- (7.39 KiB) Downloaded 35 times
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: login script using cookies. page does't redirect
Code: Select all
if ($cookie_set==true)
{
if ($login==true)
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Re: login script using cookies. page does't redirect
Thank you very much brother.......
it was my silly mistake
