TutorMe Posted September 7, 2007 Share Posted September 7, 2007 Is there a way to check if a page was called from another page? Like if I have a link on a page called "index.php" that links to "register.php," can I put a code at the top of "register.php" that checks if it was opened through "index.php?" Sorry if that's confusing. Quote Link to comment https://forums.phpfreaks.com/topic/68413-referenced/ Share on other sites More sharing options...
lemmin Posted September 7, 2007 Share Posted September 7, 2007 $_SERVER['HTTP_REFERER'] will contain the URL of the page that linked to the current one. If you use basename on it, you can get just the file. echo basename($_SERVER['HTTP_REFERER']); Quote Link to comment https://forums.phpfreaks.com/topic/68413-referenced/#findComment-343952 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.