fraser5002 Posted February 5, 2011 Share Posted February 5, 2011 Hi , I have a login page that i acces via www.mydomain.com/logib.php?last_visited_page.php however the passed in variable last_visited_page.com is not always set . once the login script has run , when the variable it is not set i would want jump to myaccount.php otherwise jump to last_visited_page.php How do i check for no variable beinf present and therefore jump to myaccount.php Many Thanks Fraser Quote Link to comment Share on other sites More sharing options...
PaulRyan Posted February 5, 2011 Share Posted February 5, 2011 To work this correctly you should have the url as something like mydomain.com/login.php?last=lastPage.php... Then you can use the following to check if it exists and if so to use it. <?PHP if(isSet($_GET['last'])) { $lastPage = $_GET['last']; } else { $lastPage = 'myaccount.php'; } ?> Obviously you may have to do some more checks to make sure the data is correct and valid, but that should give you a start Regards, PaulRyan. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.