<?php  include("conn/conn.php");
if($Submit=="提交"){
   if(preg_match("/^(\d{11})$/",$customer_tel,$counts)){ 
     if(preg_match("/\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/",$customer_mail,$counts)){   
$query=mysql_query("insert into tb_customer(tb_customer_name,tb_customer_tel,tb_customer_mail,tb_customer_address,tb_customer_category,tb_customer_birthday)values('".$customer_name."','".$customer_tel."','".$customer_mail."','".$customer_address."','".$customer_category."','".$customer_birthday."')");

echo "<script>alert('客户添加成功！');history.back();</script>";

 }else{
         echo "<script>alert('您输入的邮箱地址的格式不正确!!');history.back()</script>";

}}else{
         echo "<script>alert('您输入的电话号码的格式不正确!!');history.back()</script>";
}}
?>