<!doctype html><html lang="zh-cmn-hans"><head><meta charset="utf-8"><title></title><meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" /><meta name="apple-mobile-web-app-capable" content="yes" /><meta name="apple-mobile-web-app-status-bar-style" content="black" /><meta name="format-detection"content="telephone=no, email=no" /><meta name="apple-mobile-web-app-capable" content="yes" /><meta name="apple-mobile-web-app-status-bar-style" content="black" /><meta name="format-detection" content="telphone=no, email=no" /><meta name="renderer" content="webkit"><meta http-equiv="x-ua-compatible" content="ie=edge"><meta name="handheldfriendly" content="true"><meta name="mobileoptimized" content="320"><meta name="screen-orientation" content="portrait"><meta name="x5-orientation" content="portrait"><meta name="full-screen" content="yes"><meta name="x5-fullscreen" content="true"><meta name="browsermode" content="application"><meta name="x5-page-mode" content="app"><meta name="msapplication-tap-highlight" content="no"><link href="/cssjs/img/favicon.ico?2015080119" rel="shortcut icon" type="image/x-icon" /><link href="/cssjs/css.css?2015080119" rel="stylesheet" type="text/css" /><script src="//apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js" type="text/javascript"></script></head><body><script type="text/javascript" src="/js/global.js"></script><form id="myform"><input id="url" name='url' type='hidden'><table cellspacing="3" cellpadding="3" border="0" width="98%"><tr><input id="tel" name="tel" type="text"/><input id="submit" type="button" onclick="formone()" value="提交"/></td></tr></table></form></body></html>
function formone(){var tel=jquery("#tel").val();var telreg=/^((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)$/;if(tel==""){alert("请输入您的联系电话!");jquery("#tel").focus();return false;}else if(!telreg.test(tel)){alert("请输入正确的联系电话!");jquery("#tel").focus();return false;}else{jquery.ajax({url:'submit.php',data:{tel:jquery("#tel").val()},type:'post',datatype:'text',success:function(msg){if(parseint(msg)!=0){alert("提交成功,点击确定进入抽奖页面...");window.location.href="http://xx.com/sitefiles/services/weixin/lottery/bigwheel.html?lotteryid=1&publishmentsystemid=1&wxopenid=&_r=6272"}else{alert("提交失败,请直接在线咨询或者拨打000官方电话!");}}})}}<?phpdefine('include_check',1);require_once('connect.php');//连接数据库$tel=stripslashes($_post['tel']);$time=date('y年m月d日h时i分s秒',time());if(isset($_post['tel']) && !empty($_post['tel'])){$query=mysql_query("insert into tel(tel,time)values('$tel','$time')");}?>
直接在数据库里面查一遍,有这个号码,就不能插入
直接在数据库里面查一遍,有这个号码,就不能插入
那这个该怎么写 这...
mysql_query select 查询电话号码为 xxx的数据,若有返回值,表示有这个号码,提示用户已存在这个号码....否则插入
关掉再开 是什么意思?
if(! mysql_num_rows(mysql_query("select * from tel where tel='$tel'))) { $query=mysql_query("insert into tel(tel,time)values('$tel','$time')");}
关掉再开 是什么意思?
if(! mysql_num_rows(mysql_query("select * from tel where tel='$tel'))) { $query=mysql_query("insert into tel(tel,time)values('$tel','$time')");}
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号