![]() |
Login and redirect after.
Good day to you all,
I have a login script which I would like the good user to be redirected. I know how to redirect a page but I don't know how to make it redirect to a after the login process. PHP Code:
Can somebody help me ? Thanks ! |
PHP Code:
|
Actually, your script already works..?
It redirects IF the login was correct, otherwise it will print out that the username or password was incorrect. Edit: Ah, you want the logged in users to be redirected from login.php if they try to access it while logged in? If so, you just do at the top of the script: php Code:
Obviously you edit the index.php to w.e page you want them to end up.. |
good luck ;)
|
Quote:
First of all, you check if the session logged is set to (int) 1. When he logged in, the session logged is set to (string) yes, so checking if it's set to 1, will always return FALSE. Secondly, you check if $username is set, but he don't even have that variable, he uses $u and $p for username and password. So it's the same thing here, this will always return FALSE. Lastly, I don't even get the point in checking your $username. You check to see if it's NOT set(=empty), and if it fullfills that requirement, you set the $username var to.. NOTHING, meaning.. you don't change the value at all. |
i posted a code i know that the vars are not the same but hey man it is him who need to fix it i just posted a sample..
but hey he can do how he wants ;) i am just trying to help.. |
| All times are GMT. The time now is 11:07 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0