<?php  include("conn/conn.php");
if($Submit=="提交"){
   if(preg_match("/^(\d{11})$/",$colleague_tel,$counts)){ 
     if(preg_match("/\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/",$colleague_mail,$counts)){   
$query=mysql_query("insert into tb_colleague(tb_colleague_name,tb_colleague_tel,tb_colleague_mail,tb_colleague_address,tb_colleague_category,tb_colleague_birthday)values('".$colleague_name."','".$colleague_tel."','".$colleague_mail."','".$colleague_address."','".$colleague_category."','".$colleague_birthday."')");

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

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

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