本文整理匯總了PHP中Surfer::track方法的典型用法代碼示例。如果您正苦於以下問題:PHP Surfer::track方法的具體用法?PHP Surfer::track怎麽用?PHP Surfer::track使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Surfer
的用法示例。
在下文中一共展示了Surfer::track方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: elseif
Logger::error(i18n::s('You are not allowed to perform this operation.'));
// an anchor is mandatory
} elseif (!is_object($anchor)) {
Safe::header('Status: 404 Not Found', TRUE, 404);
Logger::error(i18n::s('No anchor has been found.'));
// post a new query
} elseif (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
// protect from hackers
if (isset($_REQUEST['edit_name'])) {
$_REQUEST['edit_name'] = preg_replace(FORBIDDEN_IN_NAMES, '_', $_REQUEST['edit_name']);
}
if (isset($_REQUEST['edit_address'])) {
$_REQUEST['edit_address'] = encode_link($_REQUEST['edit_address']);
}
// track anonymous surfers
Surfer::track($_REQUEST);
// this is the exact copy of what end users has typed
$item = $_REQUEST;
// from form fields to record columns
if (!isset($_REQUEST['edit_id'])) {
$_REQUEST['edit_id'] = Surfer::get_id();
}
$_REQUEST['create_address'] = $_REQUEST['edit_address'];
$_REQUEST['create_name'] = $_REQUEST['edit_name'];
if (!$_REQUEST['create_name']) {
$_REQUEST['create_name'] = $_REQUEST['create_address'];
}
if (!$_REQUEST['create_name']) {
$_REQUEST['create_name'] =& i18n::c('(anonymous)');
}
// always auto-publish queries