View Single Post
Old 11-06-2011, 01:18 PM  
IllTestYourGirls
Ah My Balls
 
IllTestYourGirls's Avatar
 
Industry Role:
Join Date: Feb 2007
Location: Under the gold leaf ICQ 388-454-421
Posts: 14,311
"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?
__________________
IllTestYourGirls is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote