iUnknown
27-02-2008, 06:28 PM
Hello,
Basically, I need to make a script that shows certain code "if" you have "HTTP_REFERER" of index.php, but "else" you get redirected to index.php. I need it to work in as many internet browsers as possible but just internet explorer is fine.
I have had a go at it myself but can't seem to actually get it working.
Here are snippets of code:
index.inc.php:
<?
$_httpreferer = $_SERVER['HTTP_REFERER'];
if ($_httpreferer == "index.php") {
?>At the end of the content on index.inc.php....
<?php
}
else {
header("Location: index.php");
}
?>
Errors:
Notice: Undefined index: HTTP_REFERER in /home/youngmus/public_html/browse/index.inc.php on line 3
Notice: Undefined variable: _httpreferer in /home/youngmus/public_html/browse/index.inc.php on line 3
Notice: Undefined variable: _httpreferer in /home/youngmus/public_html/browse/index.inc.php on line 4
Warning: Cannot modify header information - headers already sent by (output started at /home/youngmus/public_html/browse/index.inc.php:3) in /home/youngmus/public_html/browse/index.inc.php on line 126
Any ideas on how to get it to work?
Basically, I need to make a script that shows certain code "if" you have "HTTP_REFERER" of index.php, but "else" you get redirected to index.php. I need it to work in as many internet browsers as possible but just internet explorer is fine.
I have had a go at it myself but can't seem to actually get it working.
Here are snippets of code:
index.inc.php:
<?
$_httpreferer = $_SERVER['HTTP_REFERER'];
if ($_httpreferer == "index.php") {
?>At the end of the content on index.inc.php....
<?php
}
else {
header("Location: index.php");
}
?>
Errors:
Notice: Undefined index: HTTP_REFERER in /home/youngmus/public_html/browse/index.inc.php on line 3
Notice: Undefined variable: _httpreferer in /home/youngmus/public_html/browse/index.inc.php on line 3
Notice: Undefined variable: _httpreferer in /home/youngmus/public_html/browse/index.inc.php on line 4
Warning: Cannot modify header information - headers already sent by (output started at /home/youngmus/public_html/browse/index.inc.php:3) in /home/youngmus/public_html/browse/index.inc.php on line 126
Any ideas on how to get it to work?