cs1h Posted November 23, 2007 Share Posted November 23, 2007 Hi, I have a script that is designed to redirect a user that is not signed in, but I want to be able to attach the current page URL onto the page that the person gets redirected to. The code so far is, <?php $username = $_COOKIE['loggedin']; if (!isset($_COOKIE['loggedin'])) die("<meta http-equiv=\"refresh\" content=\"1; URL=log.php?old=CURRENT URL HERE\">"); ?> Does anyone know how to grab the url and insert it into the script? Thanks, Colin Quote Link to comment Share on other sites More sharing options...
Stephen68 Posted November 23, 2007 Share Posted November 23, 2007 If you are trying to find out where they came from with out going through the login you could use. $_SERVER['HTTP_REFERER'] and stick it into your your meta redirect I guess, just my thoughts Stephen Quote Link to comment Share on other sites More sharing options...
~n[EO]n~ Posted November 23, 2007 Share Posted November 23, 2007 Try this, page name only <?php $pageName=basename($_SERVER['PHP_SELF'] ); echo $pageName; ?> 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.