@$link=$HTTP_GET_VARS['link']; @$wmid=$HTTP_GET_VARS['wmid']; @$custom=$HTTP_GET_VARS['custom']; $siteurl="http://www.gallerycarre.com/"; $ccbillurl="http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=916412-0008&PA="; $nncashurl="http://www.newnudecash.com/hit.php?s=2&p=2&w="; if($link!="")$l=$link; elseif($wmid!='' and CheckRef($wmid)==1) if($custom=="")$l=$ccbillurl.$wmid;else $l=$ccbillurl.$wmid.'&HTML='.$custom; elseif($wmid!='' and CheckRef($wmid)==2) if($custom=="")$l=$nncashurl.$wmid;else $l=$nncashurl.$wmid.'&u='.$custom; elseif($wmid=='' or CheckRef($wmid==3)) //this is redirect directly to the site in case when something wrong //with wmid or it doesn't exist or the gallery is posted witout any //parameter //uncomment if you need it, the problem is that it shows gallery in nncash admin //without any parameters and when webmaster click on it will redirect him - not good //header('location:'.$siteurl) ; function CheckRef($refid) { $i=substr($refid,0,1); if(in_array($i,array(2,3,4,5,6,7,8,9)) and strlen($refid)==6) return 1; else { $i=substr($refid,0,2); if($i==10 and strlen($refid)==6) return 2; else return 3; } } ?>