global->resources->default_setup->connection->host; $dbuser = $xml->global->resources->default_setup->connection->username; $dbpw = $xml->global->resources->default_setup->connection->password; $dbname = $xml->global->resources->default_setup->connection->dbname; if ($xml->global->resources->db->table_prefix != "") $dbprefix = $xml->global->resources->db->table_prefix . "."; // for debug proposes, so you know it is loading the right values /** echo "
dbhost: ".$dbhost. "
dbuser: ".$dbuser. "
dbpw: ".$dbpw. "
dbname: ".$dbname. "
dbprefix: ".$dbprefix."
"; die(); **/ // ###################################################################### Get Banner Information $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; // from witch page got here $qstring = isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : ''; // what is the full query string info $addid = isset($_GET['adid']) ? $_GET['adid'] : ''; // advertisement ID $landing = isset($_GET['page']) ? $_GET['page'] : ''; // landing page (if none, will redirect to last line) $date = date(DATE_RFC822); // current date $clientIp = getenv("REMOTE_ADDR"); // client IP // ###################################################################### Create Insert Statement mysql_connect($dbhost,$dbuser,$dbpw); @mysql_select_db($dbname) or die("Unable to select database"); $query = "INSERT INTO " . $dbprefix . "ads_tracking " . "(ad_datetime, ad_referer, ad_click, ad_clientip, ad_querystring) " . "VALUES " . "(NOW(), '$referer', '1', '$clientIp', '$addid');"; // ###################################################################### Execute Insert Statement $result = mysql_query($query); if (!$result) { //die('Invalid query: ' . mysql_error()); } mysql_close(); // ###################################################################### Redirect User to Landing Page if(strlen($landing) > 0) header("Location: $landing"); else header("Location: http://www.mydomain.com/"); // TODO: Add your Store URL here ?>