IllTestYourGirls |
11-06-2011 01:18 PM |
"if anchor" Help Any Ideas? Coders Inside
I am trying to show a set of ads for a group of about 20 sites or so and another set of sites another ad but show a different set of ads for everyone else. This is what I have for a code
Code:
<?
$ref = getenv('HTTP_REFERER');
$anchor = preg_replace("/http:\/\//i", "", $ref);
$anchor = preg_replace("/^www\./i", "", $anchor);
$anchor = preg_replace("/\/.*/i", "", $anchor);
if ($anchor=="domain.com")
{ ?>ads<?}
if (($anchor === "domain1.com") OR ($anchor === "domain2.com") OR ($anchor === "domain3.com"))
{ ?>ad space here<?}
else { ?>other ad here<?}
?>
Problem is the code is showing both the if and the else ads. Any ideas how to fix it?
|