/    Sign up×
Community /Pin to ProfileBookmark

HTTP REFERER Problem

Ok so this works perfectly fine on my own windows test box webserver but when I upload it to my website it doesnt work at all, It gives me the error in this php script, and iv determined the problem lies in the HTTP Referer method used, so is there any way to just remove this? Like just keep the main functionality of the script but remove the checking of the HTTP Referer?

[code=php] <?
include(“const.php”);
if ((stristr($HTTP_REFERER,$SERVER_NAME)) || ($action == “gameranks”) || ($action == “top10”) || ($action == “login”) || ($action == “signup”) || ($action == “count”) || (($action == “game”) && ($HTTP_REFERER)))
{
if (!$link = @mysql_connect($dbhost,$dbuser,$dbpass))
{
include(“html.php”);
HTMLbegincompact(“Database Error!”);
print “The game database is currently unavailable. Please try again later.n”;
HTMLendcompact();
exit;
}
mysql_select_db($dbname);
if ($action == “game”)
$action = “main”;
include(“$action.php”);
}
else
{
include(“html.php”);
HTMLbegincompact(“Error!”);
?>
<table>
<tr><th style=”color:#00006F;background-color:#FFFF9F”>Security Violation</th></tr>
<tr><td>We have determined that you are accessing the game the wrong way, or an error might have occurred.<br>
<?
if (!$HTTP_REFERER)
print “You may NOT access in-game pages via bookmarks!<br>n”;
else print “You attempted to view this page from $HTTP_REFERER, which is not on $SERVER_NAME.<br>n”;
?>
If this error persists take the following steps in the following order:<br>
1) Return to <?=$config[home]?> and re-login.<br>
2) Upgrade your internet browser.<br>
3) Contact the game administrator at <?=$config[adminemail]?><br>
4) Contact your ISP.<br></td></tr>
</table>
<?
HTMLendcompact();
}
?>[/code]

Thanks

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@Jarrod1937May 01.2010 — Can you post the error you receive when using the code?
Copy linkTweet thisAlerts:
@4789787authorMay 02.2010 — It gives me the error that's in the code, at the spot where the wordsare
×

Success!

Help @4789787 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...