The following will detect the referring http address:
PHP Code:
<?php
$page_name = $_SERVER['HTTP_REFERER'];
echo $page_name;
?>
The following is a javascript redirect script:
PHP Code:
<script type="text/javascript">
window.location = "http://www.google.com/"
</script>
Or you could use some variation of the following which loosely puts script 1 and 2 together:
PHP Code:
$page_name = $_SERVER['HTTP_REFERER'];
$page_name=substr($page_name,0,15);
if ($page_name != 'http://www.ebay')
{
header("location: http://www.google.com");
exit();
}
?>
I thought about using strpos($haystack, $needle), but it seems to me that it would be too easy to spoof.
Bookmarks