本文整理匯總了PHP中check::CheckMobilePhone方法的典型用法代碼示例。如果您正苦於以下問題:PHP check::CheckMobilePhone方法的具體用法?PHP check::CheckMobilePhone怎麽用?PHP check::CheckMobilePhone使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類check
的用法示例。
在下文中一共展示了check::CheckMobilePhone方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: intval
$strLink = '';
if (empty($_GET['page'])) {
$intPage = 1;
} else {
$intPage = intval($_GET['page']);
}
$strWhere = implode(' AND ', $arrWhere);
$strWhere = 'where ' . $strWhere;
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (empty($_POST['title'])) {
check::AlertExit("請填寫手機!", -1);
}
if (empty($_POST['yzm'])) {
check::AlertExit("請填寫驗證碼!", -1);
}
if (!check::CheckMobilePhone($_POST['title'])) {
check::AlertExit("請填寫正確的手機號碼!", -1);
}
if ($_POST['mobilecode'] != $_POST['yzm']) {
check::AlertExit("驗證碼輸入錯誤!", -1);
} else {
$arrTemp = $objWebInit->getInfoWhere("where title='{$_POST['title']}'");
if (!empty($arrTemp)) {
check::AlertExit("該手機已經訂閱了!", -1);
} else {
unset($_POST['button']);
unset($_POST['button2']);
unset($_POST['yzm']);
unset($_POST['mobilecode']);
$objWebInit->saveInfo($_POST, 0);
}
示例2: explode
check::AlertExit("錯誤:間隔符沒填!", -1);
}
if (empty($_POST['mobiles'])) {
check::AlertExit("錯誤:手機號沒填!", -1);
}
if (empty($_POST['content'])) {
check::AlertExit("錯誤:短信內容沒填!", -1);
}
//解析手機號開始
$strSpacemark = $_POST['spacemark'];
$strMobiles = $_POST['mobiles'];
$arrMobiles = explode($strSpacemark, $strMobiles);
$arrValidMobiles = array();
foreach ($arrMobiles as $v) {
$v = trim($v);
if (check::CheckMobilePhone($v)) {
$arrValidMobiles[] = $v;
}
}
if (count($arrValidMobiles) == 0) {
check::AlertExit("錯誤:填寫的手機號都不合法!", -1);
}
$strMobiles = implode(";", $arrValidMobiles);
//解析手機號完成
$objSms = new BizSMS();
$objSms->setParam($yx_arrMBizParam);
//設置商務領航短信接口的基本參數
$strResult = $objSms->sendShortMessage($strMobiles, $_POST['content']);
//從頁麵中獲取手機號和短信內容
$strReturnCode = substr($strResult, 0, 1);
if ($strReturnCode == "0") {
示例3: userLogin
/**
* 會員登陸
* @author 肖飛
* @param array $arrUser 會員信息數組
* @return void
*/
public function userLogin($arrData, $isEncryption = 0, $jamStr, $isAlert = ture)
{
if (!check::CheckUser($arrData['User']) && !check::CheckEmailAddr($_POST['User']) && !check::CheckMobilePhone($_POST['User'])) {
if ($isAlert) {
check::AlertExit("輸入的用戶名必須是4-21字符之間的數字、字母,或7個中文!", -1);
} else {
return 0;
}
}
if (!check::CheckPassword($arrData['Pass'])) {
if ($isAlert) {
check::AlertExit("輸入的密碼必須是4-21字符之間的數字、字母!", -1);
}
return 0;
}
$strPassTemp = $arrData['Pass'];
if ($isEncryption) {
$strPassTemp = check::strEncryption($strPassTemp, $jamStr);
}
$strUserName = $arrData['User'];
if ($_SESSION['user_group'] == 3) {
$strSQL = "SELECT * FROM {$this->tablename1} WHERE user_name = '" . $strUserName . "' and status=1";
$rs = $this->db->query($strSQL);
} else {
$strSQL = "SELECT * FROM {$this->tablename1} WHERE user_name = '" . $strUserName . "' and password = '" . $strPassTemp . "' and status=1";
$rs = $this->db->query($strSQL);
if (!($arr = $rs->fetch(PDO::FETCH_ASSOC))) {
$strSQL = "SELECT * FROM {$this->tablename1} WHERE email = '" . $strUserName . "' and password = '" . $strPassTemp . "' and status=1";
$rs = $this->db->query($strSQL);
if (!($arr = $rs->fetch(PDO::FETCH_ASSOC))) {
$strSQL = "SELECT * FROM {$this->tablename1} WHERE mobile = '" . $strUserName . "' and password = '" . $strPassTemp . "' and status=1";
$rs = $this->db->query($strSQL);
$arr = $rs->fetch(PDO::FETCH_ASSOC);
}
}
}
if ($arr) {
if (is_array($_SESSION)) {
$_SESSION = array_merge($_SESSION, $arr);
} else {
$_SESSION = $arr;
}
$arrUpdate = array();
$arrUpdate['user_ip'] = check::getIP();
$arrUpdate['lastlog'] = date('Y-m-d H:i:s');
$arrUpdate['user_id'] = $arr['user_id'];
$arrUpdate['logtimes'] = ++$arr['logtimes'];
$arrUpdate['session_id'] = session_id();
$this->updateUser($arrUpdate);
return 1;
} else {
if ($isAlert) {
check::AlertExit("用戶名或密碼錯誤", -1);
} else {
return 0;
}
}
}