Ejemplo n.º 1
0
function registerEmail()
{
    $email = addslashes($_POST['email']);
    $regex = new regexTool();
    $sql = "select * from tuhao_user where email = '{$email}'";
    if (!$regex->isEmail($email)) {
        $message = array('success' => false, 'mes' => '邮箱格式错误');
    } elseif (fetchOne($sql)) {
        $message = array('success' => false, 'mes' => '邮箱被占用');
    } else {
        $message = array('success' => true, 'mes' => '');
    }
    return json_encode($message);
}
  */
 $data['title'] = $title;
 $data['positionName'] = $positionName;
 $data['address'] = $address;
 // 		if ($regex->isNumber ( $ageRequire )) {
 // 			$data ['ageRequire'] = $ageRequire;
 // 		} else {
 // 			$error = 4; // 年龄格式不正确
 // 		}
 if ($regex->isMobile($telephone)) {
     $data['telephone'] = $telephone;
 } else {
     $error = 4;
     // 手机格式不正确
 }
 if ($regex->isEmail($email)) {
     $data['email'] = $email;
 } else {
     $error = 5;
     // 邮箱格式不正确
 }
 $data['sexRequire'] = $sexRequire;
 // 		$data ['eduRequire'] = $eduRequire;
 $data['other'] = $other;
 $data['salary'] = $salary;
 $data['content'] = $content;
 if ($regex->isNumber($num)) {
     $data['num'] = $num;
 } else {
     $error = 6;
     // 人数格式不正确
Ejemplo n.º 3
0
 $subcom['email'] = $_GET['email'];
 $subcom['coordinate'] = $_GET['coordinate'];
 $subcom['isTop'] = $_GET['top'];
 // $subcom['companyName']='子公司名称32';
 // $subcom['address']='山东省青岛市黄岛区32号';
 // $subcom['phone']='13897789090';
 // $subcom['email']='*****@*****.**';
 // $subcom['coordinate']='89.5341,87.145646';
 if (empty($subcom['companyName']) || empty($subcom['address']) || empty($subcom['phone']) || empty($subcom['email'])) {
     echo 2;
     //请检查空值
 } else {
     if (empty($subcom['coordinate'])) {
         echo 3;
         //坐标值获取失败
     } elseif (!$regex->isEmail($subcom['email'])) {
         echo 4;
         //email格式错误
     } else {
         //判断是否有置顶项,若有,则取消其他置顶
         if ($subcom['isTop'] == 1) {
             $sql_top = "select id from wx_map where isTop=1";
             $res_top = $db->getrow($sql_top);
             if (!empty($res_top)) {
                 $sql_topDel = "update wx_map set isTop=0 where id=" . $res_top['id'];
                 $res_topDel = $db->execsql($sql_topDel);
             }
         }
         //判断同一子公司名称是否重复添加
         $sql_repeat = "select id from wx_map where companyName='{$subcom['companyName']}'";
         $res_repeat = $db->getrow($sql_repeat);
Ejemplo n.º 4
0
<?php

require_once 'regexTool.class.php';
$regex = new regexTool();
if (!$regex->noEmpty($_POST['username'])) {
    exit('用户名是必须填写的!');
}
if (!$regex->isEmail($_POST['email'])) {
    exit('email格式错误!');
}
if (!$regex->isMobile($_POST['mobile'])) {
    exit('手机号格式错误!');
}
//数据库写入
/*
 * @name : show
 * @description : output debug
 * @param $var : input data
 * @return void
 */
function show($var = null, $isdump = false)
{
    $func = $isdump ? 'var_dump' : 'print_r';
    if (empty($var)) {
        echo 'null';
    } elseif (is_array($var) || is_object($var)) {
        //array,object
        echo '<pre>';
        $func($var);
        echo '</pre>';
    } else {