<?php
if(trim(@$_POST['name'])==''){
$err=2;
}
if(trim(@$_POST['tel'])==''){
$err=1;
}else{
@$_POST['time']=time();
@$_POST['source']=@$_SERVER['HTTP_REFERER'];
@$_POST['ip']=@$_SERVER['REMOTE_ADDR'];
@$_POST['content']=@$_POST['content'].@$_POST['tel'];
$err='';
}

$pattern_url = "/(http|ftp|https|www|\.com|\.cn|\.net)+/"; 
if(preg_match($pattern_url, @$_POST['content'])) 
{ 
showMsg('插入成功!', 'javascript:;');
exit();
}
if($err==1){
showMsg('手机号码不能为空,程序返回', '-1');
exit();
}
if($err==2){
showMsg('姓名不能为空,程序返回', '-1');
exit();
}

  注意:@$_POST['time']=time(); 填写后后台显示留言信息才正确2018-03-20 07:40

相关文章:

  • 2022-01-29
  • 2022-12-23
  • 2021-11-29
  • 2022-12-23
  • 2021-06-16
  • 2021-10-29
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-17
  • 2021-07-22
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
相关资源
相似解决方案