本文整理汇总了PHP中HttpRequest::QueryString方法的典型用法代码示例。如果您正苦于以下问题:PHP HttpRequest::QueryString方法的具体用法?PHP HttpRequest::QueryString怎么用?PHP HttpRequest::QueryString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpRequest
的用法示例。
在下文中一共展示了HttpRequest::QueryString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Redirect
/**
* Redirects the application using headers and client-side http headers.
* Should be only called within a controller.
*
* @param String $NewLocation the new application
*/
function Redirect($NewLocation, $RedirectParamsAsWell = false, $HowManyParamsToStrip = 0)
{
if ($RedirectParamsAsWell) {
$x = explode("&", HttpRequest::QueryString());
while ($HowManyParamsToStrip--) {
if (is_array($x) && count($x) > 1) {
array_shift($x);
}
}
$x = implode("&", $x);
if ($x) {
if (strpos($NewLocation, "?") === false) {
$x = "?{$x}";
} elseif (strpos($NewLocation, "?") === strlen($NewLocation) - 1) {
$x = "{$x}";
} else {
$x = "&{$x}";
}
}
} else {
$x = "";
}
header("location: {$NewLocation}{$x}");
exit;
}
示例2: Insert
function Insert()
{
if (jf::$RunMode->IsCLI()) {
return false;
}
$res = jf::SQL("INSERT INTO {$this->TablePrefix()}stats (UserID,SessionID,Timestamp,Page,Query,IP,Host,Protocol,UserAgent) VALUES\n\t\t\t(?,?,?,?,?,?,?,?,?)", jf::CurrentUser() ?: 0, jf::$Session->SessionID(), jf::time(), HttpRequest::URI(), HttpRequest::QueryString(), HttpRequest::IP(), HttpRequest::Host(), HttpRequest::Protocol(), HttpRequest::UserAgent());
return $res;
}