redirect info
Moderator: General Moderators
redirect info
is there a function or a way to find out the page that opened the curent page.I mean if code.php sends you to search.php,in search.php how can I find out that code.php send me here?
If you created the referring page, you can use session files and session file check on the receiving page.
And on the receiving page:
Code: Select all
<?php
session_start();
$_SESSION['REFERER'] = $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
header('Location: receiver.php');
?>Code: Select all
<?php
session_start();
if ($_SESSION['REFERER'] == 'http://www.yourdomain.com/sending.php') {
//woo!
} else {
//boo!
}
?>- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact: