當前位置: 首頁>>代碼示例>>PHP>>正文


PHP HttpRequest::Host方法代碼示例

本文整理匯總了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}>");
 }
開發者ID:michalkoczwara,項目名稱:WebGoatPHP,代碼行數:8,代碼來源:signup.php

示例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;
 }
開發者ID:michalkoczwara,項目名稱:WebGoatPHP,代碼行數:8,代碼來源:stats.php

示例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}>");
 }
開發者ID:michalkoczwara,項目名稱:WebGoatPHP,代碼行數:9,代碼來源:reset.php

示例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());
開發者ID:michalkoczwara,項目名稱:WebGoatPHP,代碼行數:31,代碼來源:application.php


注:本文中的HttpRequest::Host方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。