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


PHP WebRequest::postString方法代碼示例

本文整理匯總了PHP中WebRequest::postString方法的典型用法代碼示例。如果您正苦於以下問題:PHP WebRequest::postString方法的具體用法?PHP WebRequest::postString怎麽用?PHP WebRequest::postString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WebRequest的用法示例。


在下文中一共展示了WebRequest::postString方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: runPage

 protected function runPage()
 {
     if (WebRequest::wasPosted()) {
         if (!($email = WebRequest::postString("lgEmail"))) {
             // no email address specified
             $this->redirect("noemail");
             return;
         }
         if (!($password = WebRequest::postString("lgPasswd"))) {
             // no password specified
             $this->redirect("nopass");
             return;
         }
         $cust = Customer::getByEmail($email);
         if ($cust == null) {
             // customer doesn't exist. offer to signup or retry?
             $this->redirect("invalid");
             return;
         }
         if (!$cust->isMailConfirmed()) {
             // customer hasn't confirmed their email
             $this->redirect("noconfirm");
             return;
         }
         if (!$cust->authenticate($password)) {
             // not a valid password
             $this->redirect("invalid");
             return;
         }
         // seems to be ok.
         // set up the session
         Session::setLoggedInCustomer($cust->getId());
         // redirect back to the main page.
         $this->redirect();
     } else {
         // urm, something's not quite right here...
         // redirect back to the main page.
         $this->mHeaders[] = "HTTP/1.1 303 See Other";
         $this->mHeaders[] = "Location: " . $cWebPath . "/index.php";
     }
 }
開發者ID:vulnerabilityCode,項目名稱:hotel-system,代碼行數:41,代碼來源:PageLogin.php

示例2: runPage

 protected function runPage()
 {
     $this->mBasePage = "book.tpl";
     global $cWebPath;
     $this->mStyles[] = $cWebPath . '/style/jsDatePick_ltr.min.css';
     $this->mScripts[] = $cWebPath . '/scripts/jsDatePick.full.1.3.js';
     // set up the default values for the
     if (WebRequest::wasPosted()) {
         $this->mSmarty->assign("valQbCheckin", WebRequest::postString("qbCheckin"));
         $this->mSmarty->assign("valQbCheckout", WebRequest::postString("qbCheckout"));
         $this->mSmarty->assign("valQbAdults", WebRequest::postInt("qbAdults"));
         $this->mSmarty->assign("valQbChildren", WebRequest::postInt("qbChildren"));
         $this->mSmarty->assign("valQbPromoCode", WebRequest::postString("qbPromoCode"));
     } else {
         $this->mSmarty->assign("valQbCheckin", "");
         $this->mSmarty->assign("valQbCheckout", "");
         $this->mSmarty->assign("valQbAdults", "");
         $this->mSmarty->assign("valQbChildren", "");
         $this->mSmarty->assign("valQbPromoCode", "");
     }
     if (Session::isCustomerLoggedIn()) {
         $customer = Customer::getById(Session::getLoggedInCustomer());
         $this->mSmarty->assign("qbTitle", $customer->getTitle());
         $this->mSmarty->assign("qbFirstname", $customer->getFirstname());
         $this->mSmarty->assign("qbLastname", $customer->getSurname());
         $this->mSmarty->assign("qbAddress", $customer->getAddress()->getLine1());
         $this->mSmarty->assign("qbCity", $customer->getAddress()->getCity());
         $this->mSmarty->assign("qbPostcode", $customer->getAddress()->getPostcode());
         $this->mSmarty->assign("qbCountry", $customer->getAddress()->getCountry());
         $this->mSmarty->assign("qbEmail", $customer->getEmail());
     } else {
         $this->mSmarty->assign("qbTitle", "");
         $this->mSmarty->assign("qbFirstname", "");
         $this->mSmarty->assign("qbLastname", "");
         $this->mSmarty->assign("qbAddress", "");
         $this->mSmarty->assign("qbCity", "");
         $this->mSmarty->assign("qbPostcode", "");
         $this->mSmarty->assign("qbEmail", "");
         $this->mSmarty->assign("qbCountry", " ");
     }
 }
開發者ID:vulnerabilityCode,項目名稱:hotel-system,代碼行數:41,代碼來源:PageBook.php

示例3: showCal

 public function showCal()
 {
     $this->mBasePage = "cal.tpl";
     global $cWebPath;
     $startdate = new DateTime(WebRequest::post("qbCheckin"));
     $enddate = new DateTime(WebRequest::post("qbCheckout"));
     $idlist = Room::getIdList();
     $dates = array();
     for ($date = $startdate; $date < $enddate; $date->modify("+1 day")) {
         $dates[] = clone $date;
     }
     $availabilityMatrix = array();
     $roomlist = array();
     foreach ($idlist as $id) {
         $r = Room::getById($id);
         $roomlist[$id] = $r;
         $availabilityMatrix[$id] = array();
         foreach ($dates as $d) {
             $availabilityMatrix[$id][array_search($d, $dates)] = !$r->isAvailable($d);
         }
     }
     $this->mSmarty->assign("availmatrix", $availabilityMatrix);
     $this->mSmarty->assign("datelist", $dates);
     $this->mSmarty->assign("roomlist", $roomlist);
     $this->mSmarty->assign("valQbCheckin", WebRequest::postString("qbCheckin"));
     $this->mSmarty->assign("valQbCheckout", WebRequest::postString("qbCheckout"));
     $this->mSmarty->assign("valQbAdults", WebRequest::postInt("qbAdults"));
     $this->mSmarty->assign("valQbChildren", WebRequest::postInt("qbChildren"));
     $this->mSmarty->assign("valQbPromoCode", WebRequest::postString("qbPromoCode"));
     $this->mSmarty->assign("valQbTitle", WebRequest::post("qbTitle"));
     $this->mSmarty->assign("valQbFirstname", WebRequest::post("qbFirstname"));
     $this->mSmarty->assign("valQbLastname", WebRequest::post("qbLastname"));
     $this->mSmarty->assign("valQbAddress", WebRequest::post("qbAddress"));
     $this->mSmarty->assign("valQbCity", WebRequest::post("qbCity"));
     $this->mSmarty->assign("valQbPostcode", WebRequest::post("qbPostcode"));
     $this->mSmarty->assign("valQbCountry", WebRequest::post("qbCountry"));
     $this->mSmarty->assign("valQbEmail", WebRequest::post("qbEmail"));
 }
開發者ID:vulnerabilityCode,項目名稱:hotel-system,代碼行數:38,代碼來源:PageCalendar.php


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