本文整理汇总了PHP中Tracking::get_uid方法的典型用法代码示例。如果您正苦于以下问题:PHP Tracking::get_uid方法的具体用法?PHP Tracking::get_uid怎么用?PHP Tracking::get_uid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tracking
的用法示例。
在下文中一共展示了Tracking::get_uid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: track
static function track($server, $cache_hash, $ref)
{
$db = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
mysql_select_db(DB_DATABASE, $db);
mysql_query("SET NAMES utf8");
$page_url = Tracking::get_page_url();
$ip_address = Tracking::get_client_ip();
$user_agent = Tracking::get_user_agent();
$ua = Tracking::parse_user_agent();
$ua["browser"] = empty($ua["browser"]) ? "n/a" : $ua["browser"];
$ua["version"] = empty($ua["version"]) ? "n/a" : $ua["version"];
$ua["platform"] = empty($ua["platform"]) ? "n/a" : $ua["platform"];
$current_url = $ref == 1 ? Tracking::parse_location($server["HTTP_REFERER"]) : Tracking::parse_location("http://" . $server["HTTP_HOST"] . $server["REQUEST_URI"]);
$utm_source = $current_url["utm_source"];
$utm_medium = $current_url["utm_medium"];
$utm_campaign = $current_url["utm_campaign"];
$utm_content = $current_url["utm_content"];
$utm_term = $current_url["utm_term"];
$utm_id = $current_url["utm_id"];
$gclid = $current_url["gclid"];
$qry = '
INSERT INTO
tracking_visits
VALUES
(
null,
"' . mysql_real_escape_string($page_url) . '",
"' . mysql_real_escape_string($ip_address) . '",
"' . mysql_real_escape_string(Tracking::get_uid($server)) . '",
"' . mysql_real_escape_string($user_agent) . '",
"' . mysql_real_escape_string($ua["browser"]) . '",
"' . mysql_real_escape_string($ua["version"]) . '",
"' . mysql_real_escape_string($ua["platform"]) . '",
"",
"",
"",
"",
"",
"",
"",
"",
"' . Tracking::get_user_language($_SERVER["HTTP_ACCEPT_LANGUAGE"]) . '",
"' . mysql_real_escape_string($utm_source) . '",
"' . mysql_real_escape_string($utm_medium) . '",
"' . mysql_real_escape_string($utm_campaign) . '",
"' . mysql_real_escape_string($utm_content) . '",
"' . mysql_real_escape_string($utm_term) . '",
"' . (int) $utm_id . '",
"' . mysql_real_escape_string($gclid) . '",
"' . (int) $cache_hash . '",
null
)
';
mysql_query($qry);
$id = mysql_insert_id();
return $id;
}
示例2: dirname
<?php
include_once dirname(__FILE__) . "/tracking.class.php";
include_once dirname(__FILE__) . "/config.php";
Tracking::clear_old();
$cache_hash = Tracking::caching_hash();
$uid = Tracking::get_uid($_SERVER);
$_SESSION["visits"][$cache_hash] = array("time" => time(), "data" => Tracking::prepare_session($_SERVER, $cache_hash, $uid));
header('Content-type:text/javascript');
echo "var uid='{$uid}';";
echo "var ch='{$cache_hash}';";
echo "var postUrl = '" . TRACK_URL . "';";
readfile(dirname(__FILE__) . "/post.js");