All pastes #544120 Raw Edit

Stuff

public text v1 · immutable
·published 2007-06-06 09:18 UTC
rendered paste body
/* ======== Connect to the SQL DB======== */

require('system/database.'.$cfg['sqldb'].'.php');
sed_sql_connect($cfg['mysqlhost'], $cfg['mysqluser'], $cfg['mysqlpassword'], $cfg['mysqldb']);
unset($cfg['mysqlhost'], $cfg['mysqluser'], $cfg['mysqlpassword']);

/*Hadnling incoming requests*///////////////////////////////////////////////////
if(@$_SERVER['HTTP_REFERER']){
	$urlinfo = parse_url($_SERVER['HTTP_REFERER']);
    if($urlinfo["host"] != $_SERVER['SERVER_NAME']
    	&& !strstr($_SERVER['QUERY_STRING'], "add_ingoing_click")){
      
        $SQL = "SELECT * FROM sed_link_items WHERE sl_url LIKE '%".$urlinfo["host"]."%'";
        $r = sed_sql_query($SQL);
        if($row = sed_sql_fetcharray($r)){
            sed_sql_query("INSERT
            		INTO sed_link_clicks_ingoing
                	SET
                    sl_id   = '".$row['sl_id']."',
                    slc_time = '".mktime()."'");
        }
    }
}
////////////////////////////////////////////////////////////////////////////////


/* ======== Configuration settings (from the DB) ======== */