How to redirect page after successful log in?
How to redirect page after successful log in in HTML?
what form codes should i type?
what PHP codes should i type?
Do not send any html code from the server , the browser should not receive any html codes then just in that case use the below tag to redirect to example.com you can change example.com to anything you want.
Originally Posted by heartlock
Hope it helps ....
ALL THE BEST
Just to clarify. There must not be any html code before the header command, not even a blank line:
Last edited by jedaisoul; 04-30-2014 at 05:45 PM.
Sorry for the late reply , internet connection was down in my area ... yes not any html code and I think u need not to have exit after the header command .....
To make it more clear let me just explain u with little example ....
You made login.php your default page showing login form and it post data to another php say loginvalidate.php do your validation in this script and in the same script send the html data as "SORRY NOT A VALID USERNAME AND PASSWORD" in case of not logged in then the whole login process will freeze on this script its optional to add a back link and if the user gets validated then you can just place this command as header('Location: http://yoursite.com/home.php'); or maybe i think even this will work header('Location: home.php'); in this way you are sending html only if the user is not validated but if it gets validated then simply the home.php will open you will not even get a chance to notice the route to home.php through validate.php .....
HOPE IT HELPS ....
I HOPE I MADE MYSELF CLEAR AND YOUR DOUBTS TOO ...
ALL THE BEST.....
Last edited by jayantgeek; 05-02-2014 at 12:08 PM.
i would like to ask you...
Are you trying to make some script like this site(webdeveloper.com) does on login i.e. it shows a message thankyou for login and says you will automatically be redirected to home page ..... if browser does not automatically does so click and it gives you a link to home page......
Last edited by jayantgeek; 05-02-2014 at 12:09 PM.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)