<?php


//回链访问系统
function url_come($urlid,$wapid){
$sql="SELECT url,come,siteid FROM sitelink WHERE url='{$urlid}' AND siteid='{$wapid}'";
        $view = mysql_query($sql);
        if($view && mysql_num_rows($view)>0){
        list($url,$come,$siteid) = mysql_fetch_row($view);
           }
		   return $come;
		}
if($_GET['go']!=NULL && $_GET['go']!=''){
    $vurl = url_come($_GET['go'],$wapid);
	$vurl = $vurl+1;
    $sql="UPDATE sitelink SET come='{$vurl}' WHERE url='{$_GET['go']}' AND siteid='{$wapid}'";
    $result=mysql_query($sql);
    if($result && mysql_affected_rows()>0){
	    header("location: http://".$_SERVER["HTTP_HOST"]."/?cid=".$_GET['cid']."&sid=".$sid_info);
    }

}
?>