本文整理汇总了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;
}
}
}