本文整理汇总了PHP中HttpRequest::Host方法的典型用法代码示例。如果您正苦于以下问题:PHP HttpRequest::Host方法的具体用法?PHP HttpRequest::Host怎么用?PHP HttpRequest::Host使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpRequest
的用法示例。
在下文中一共展示了HttpRequest::Host方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ActivationMail
function ActivationMail($Email, $UserID, $Username)
{
$ActivationToken = jf::$Security->RandomToken();
jf::SaveGeneralSetting("activation_{$ActivationToken}", $UserID);
$MyEmail = "admin@" . HttpRequest::Host();
$Content = "Thank you for joininig " . constant("jf_Application_Title") . " {$Username},\n\t\t\t\tPlease open the following link in order to activate your account:\n\n\t\t\t\t" . SiteRoot . "/sys/xuser/signup?validate={$ActivationToken}\n\n\t\t\t\tIf you did not sign up on this site, just ignore this email.";
return mail($Email, "Account Confirmation", $Content, "From: " . constant("jf_Application_Name") . " <{$MyEmail}>");
}
示例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;
}
示例3: ResetMail
function ResetMail($Email, $UserID)
{
$Temp = jf::$XUser->TemporaryResetPassword($UserID);
$MyEmail = "admin@" . HttpRequest::Host();
$UserInfo = jf::$XUser->UserInfo($UserID);
$Content = "You have requested to reset the password for username '{$UserInfo['Username']}',\n\t\t\t\tPlease open the following link in order to reset your password:\n\t\t\t\t\n\t\t\t\t" . SiteRoot . "/sys/xuser/reset?user={$UserID}&temp={$Temp}\n\t\t\n\t\t\t\tThe above link is valid for one hour only.\n\t\t\t\tIf you did not ask your password to be reset, just ignore this email.\n";
// echo $Content;
return mail($Email, "Account Password Recovery", $Content, "From: " . constant("jf_Application_Name") . " <{$MyEmail}>");
}
示例4: elseif
*
* Define your jframework powered web application here. Set at least a version, a Name and a
* title for your application. Name would better follow identifier rules.
*/
const jf_Application_Version = "1.0";
//put version of your application here, as a string.
const jf_Application_Name = "WebGoatPHP";
//follow identifier rules for this name
const jf_Application_Title = "OWASP WebGoatPHP";
//title of your application
/**
* Mode detection
* here jframework tries to determine what mode its running at,
* Deploy, Develop or Command Line. Provide necessary logic for it to determine correctly
*/
if (strpos(HttpRequest::Host(), "LOCALHOSTURL") !== false) {
jf::$RunMode->Add(RunModes::Develop);
} elseif (php_sapi_name() == "cli") {
jf::$RunMode->Add(RunModes::CLI);
} else {
jf::$RunMode->Add(RunModes::Deploy);
}
/**
* Siteroot
*
* jframework requires to know where your site root is, e.g http://jframework.info
* or http://tld.com/myfolder/myjf/deploy
* automatically determines this, so change it and define it manually only when necessary
* you can use this constant in your views for absolute urls
*/
define("SiteRoot", HttpRequest::Root());