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


PHP check::city方法代碼示例

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


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

示例1:

 if (!check::pass($postvar['password'], $postvar['confirmp'])) {
     main::errors(nl2br("Your passwords either do not match or contain invalid characters.  (< and > are not allowed.  O>.<O  Nor is #"));
 }
 if (!check::email($postvar['email'])) {
     main::errors(nl2br("Your email address didn't match one or more of the following:\n\n                                           Your email address:\n                                           1.) Must be in the correct format\n                                           2.) Must not be associated with another client\n                                           3.) If you're using an email address hosted with us, please make sure your email address has the proper \"MX\" or \"A\" DNS record."));
 }
 if (!check::firstname($postvar['firstname'])) {
     main::errors(nl2br("In our system, your first and last name may only contain letters and the following characters:.' - and space."));
 }
 if (!check::lastname($postvar['lastname'])) {
     main::errors(nl2br("In our system, your first and last name may only contain letters and the following characters:.' - and space."));
 }
 if (!check::address($postvar['address'])) {
     main::errors(nl2br("Your address may only contain letters, numbers and the following characters:.- and space."));
 }
 if (!check::city($postvar['city'])) {
     main::errors(nl2br("Your city may only contain letters and spaces."));
 }
 if (!check::state($postvar['state'])) {
     main::errors(nl2br("Your state may only contain letters and the following characters:.- and space"));
 }
 if (!check::zip($postvar['zip'])) {
     main::errors(nl2br("Your zip may only be 10 characters long and contain only  letters, numbers, and the following characters: - and space"));
 }
 if (!check::country($postvar['country'])) {
     main::errors(nl2br("Your country code may only contain 2 letters."));
 }
 if (!check::phone($postvar['phone'])) {
     main::errors(nl2br("Your phone number may only contain numbers and the - character and must be between 10 and 20 numbers long."));
 }
 if (!check::tzone($postvar['tzones'])) {
開發者ID:cozylife,項目名稱:tht-reworked,代碼行數:31,代碼來源:index.php

示例2: content

 public function content()
 {
     global $dbh, $postvar, $getvar, $instance;
     $client = $dbh->client($_SESSION['cuser']);
     $edit_account_array['USER'] = $client['user'];
     $edit_account_array['EMAIL'] = $client['email'];
     $edit_account_array['DOMAIN'] = $client['domain'];
     $edit_account_array['FIRSTNAME'] = $client['firstname'];
     $edit_account_array['LASTNAME'] = $client['lastname'];
     $edit_account_array['ADDRESS'] = $client['address'];
     $edit_account_array['CITY'] = $client['city'];
     $edit_account_array['STATE'] = $client['state'];
     $edit_account_array['ZIP'] = $client['zip'];
     $edit_account_array['PHONE'] = $client['phone'];
     $edit_account_array['TZADJUST'] = main::tzlist($client['tzadjust']);
     $edit_account_array['DISP'] = "<div>";
     $edit_account_array['COUNTRY'] = main::countries(1, $client['country']) . '<a title="Your country." class="tooltip"><img src="<ICONDIR>information.png" /></a>';
     if ($_POST) {
         if (!check::email($postvar['email'], $_SESSION['cuser'])) {
             main::errors("Your email is the wrong format!");
         }
         if (!check::state($postvar['state'])) {
             main::errors("Please enter a valid state!");
         }
         if (!check::address($postvar['address'])) {
             main::errors("Please enter a valid address!");
         }
         if (!check::phone($postvar['phone'])) {
             main::errors("Please enter a valid phone number!");
         }
         if (!check::zip($postvar['zip'])) {
             main::errors("Please enter a valid zip/postal code!");
         }
         if (!check::city($postvar['city'])) {
             main::errors("Please enter a valid city!");
         }
         if (!check::firstname($postvar['firstname'])) {
             main::errors("Please enter a valid first name!");
         }
         if (!check::lastname($postvar['lastname'])) {
             main::errors("Please enter a valid time last name!");
         }
         if (!main::errors()) {
             if ($postvar['country']) {
                 $country_q = "";
             }
             $users_update = array("email" => $postvar['email'], "state" => $postvar['state'], "address" => $postvar['address'], "phone" => $postvar['phone'], "zip" => $postvar['zip'], "city" => $postvar['city'], "tzadjust" => $postvar['tzones'], "firstname" => $postvar['firstname'], "lastname" => $postvar['lastname'], "country" => $postvar['country']);
             $dbh->update("users", $users_update, array("id", "=", $_SESSION['cuser']));
             if ($postvar['change']) {
                 $client = $dbh->client($_SESSION['cuser']);
                 if (crypto::passhash($postvar['currentpass'], $client['salt']) == $client['password']) {
                     if ($postvar['newpass'] === $postvar['cpass']) {
                         $cmd = main::changeClientPassword($_SESSION['cuser'], $postvar['newpass']);
                         if ($cmd === true) {
                             main::errors("Details updated!");
                         } else {
                             main::errors((string) $cmd);
                         }
                     } else {
                         main::errors("Your passwords don't match!");
                     }
                 } else {
                     main::errors("Your current password is incorrect.");
                 }
             } else {
                 $edit_account_array['DISP'] = "<div style=\"display:none;\">";
                 main::errors("Details updated!");
             }
         }
     }
     echo style::replaceVar("tpl/client/edit-account.tpl", $edit_account_array);
 }
開發者ID:cozylife,項目名稱:tht-reworked,代碼行數:72,代碼來源:details.php


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