$HTTP_REFERER problem
Posted: Mon Dec 15, 2003 10:09 am
I'm having trouble with the $HTTP_REFERER variable. I don't want to execute the contained code (update counter) if the person is browsing from a certain page. Can someone tell me why my if statement allows the contained code to run?
Thanks
Lou
<?PHP
if($HTTP_REFERER != "www.mydomain.com/index.php")
{
$db = "YouThinkIWouldTellYou";
$admin = "admin";
$adpass = "guess";
$mysql_link = mysql_connect("172.22.0.0", $admin, $adpass);
mysql_select_db($db, $mysql_link);
$result = mysql_query("SELECT impressions from tds_counter where COUNT_ID='3'", $mysql_link);
if(mysql_num_rows($result)) {
mysql_query("UPDATE tds_counter set impressions=impressions+1 where COUNT_ID='3'", $mysql_link);
$row = mysql_fetch_row($result);
if($inv != 1) {
}
}
}
?>
Thanks
Lou
<?PHP
if($HTTP_REFERER != "www.mydomain.com/index.php")
{
$db = "YouThinkIWouldTellYou";
$admin = "admin";
$adpass = "guess";
$mysql_link = mysql_connect("172.22.0.0", $admin, $adpass);
mysql_select_db($db, $mysql_link);
$result = mysql_query("SELECT impressions from tds_counter where COUNT_ID='3'", $mysql_link);
if(mysql_num_rows($result)) {
mysql_query("UPDATE tds_counter set impressions=impressions+1 where COUNT_ID='3'", $mysql_link);
$row = mysql_fetch_row($result);
if($inv != 1) {
}
}
}
?>