id) $webmaster = 0; if (!preg_match("/\d+/", $c)) $c=0; if (!$ip) $ip = getIP(); $hit = new WMHit( array( 'webmaster' => $webmaster, 'ip' => $ip ) ); //if ($conn->debug) print_r($hit); //the wm_hit.class is not setting $hit->unique in case the hit is unique if ((isset($hit->id) && !isset($hit->unique)) || $hit->unique) { $uniqueHit = 1; } else { $uniqueHit = 0; } $referral = new WMReferral( array( 'webmaster' => $webmaster, 'ip' => $ip, 'unique' => $uniqueHit, 'wm_ref_campaign' => $c) ); wm_cookie($webmaster, $referral->id, $c); if ($u!='')$wm_ref_redirect_url = $u; if ($wm_ref_redirect_url == '') $wm_ref_redirect_url = PROGRAM_URL.'/wmreg/'; header("Location: $wm_ref_redirect_url"); exit; ?>