Ashish Sood
-
Posts
79 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by Ashish Sood
-
-
I want to know one more thing, after successfully login my page will be redirect to index.php, But if someone open again login.php he also should be redirect to index.php. please guys tell me what condition i need to put in login.php page. I tried below, but after again open login.php, it am getting the error.
<?phpif(isset($_SESSION['username'])) { header('Location: index.php'); } else { header('Location: login.php'); }?>
ERROR The page isn't redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete. This problem can sometimes be caused by disabling or refusing to accept cookies.
-
Thanks More Human Than Human, Its working for me now. :Happy:
-
HI ,I am facing a problem with my logout form after destroying a session my page is not redirected to login.php, even after refresh the same page logout.php page i am gettting Notice: Undefined index: username in /var/www/html/checklist/project/login/logout.php on line 4 username, That mean my session is destroyed, but dont know why i will not get redirected..please guys advice me what i am doing wrong in this , Please find my code below. <?phpsession_start();if(isset($_SESSION['username'])){ session_destroy(); header("location: login.php"); }?>
problem with logout form
in PHP
Posted
Thanks for the reply Sir,I will show my complete code, i created two files,1.login.php (Simple HTML file In this file i included validate_login.php file at starting)2 validate_login.php (This is the main file where is check the codition and handling sessions) Login.php
Validate_login.php
I am successfully redirect to index.php page, after removing else part, but on the login.php i am getting a session error. Notice: Undefined variable: _SESSION in /var/www/html/checklist/project/login/login.php on line 3