$site_link = $_SERVER{QUERY_STRING}; $referral_link = preg_replace('@([^/]+/)?[^=/]+=@','referral=',$_SERVER{QUERY_STRING}); ?>