巴卜短信php免费手机号接收验证码验证是秒到吗?

php短信验证码接口代码示例(简单、易用)
今天给大家分享的代码示例是秒赛短信验证码平台为方便用户接入网站/app/各种系统,提供的请求的代码示例,供大家参考。php短信接口PHP短信接口代码具体内容如下:&?php
header(&Content-Type:text/charset=utf-8&);
$account&=&&***************&;&
$pswd&=&&***************&;&
//修改为您要发送的手机号
$mobile&=&&***************&;&
//发送地址,请咨询客服
$url&=&&***************&;&
//是否需要状态报告,为true即可
$needstatus&=&&true&;&
//产品,为空即可
$product&=&&&;&
$ch&=&curl_init();
/*&设置验证方式&*/
curl_setopt($ch,&CURLOPT_HTTPHEADER,&
array('Accept:text/charset=utf-8',&'Content-Type:application/x-www-form-urlencoded','charset=utf-8'));
/*&设置返回结果为流&*/
curl_setopt($ch,&CURLOPT_RETURNTRANSFER,&true);
/*&设置超时时间*/
curl_setopt($ch,&CURLOPT_TIMEOUT,&10);
/*&设置通信方式&*/
curl_setopt($ch,&CURLOPT_POST,&1);
curl_setopt($ch,&CURLOPT_SSL_VERIFYPEER,&false);
//&发送短信
$msg=&【秒赛科技】您的验证码是:1234&;&&
$data=array('msg'=&$msg,'account'=&$account,'pswd'=&$pswd,'mobile'=&
$mobile,'needstatus'=&$needstatus,'product'=&$product);
$result&=&send($ch,$data);
echo&'&pre&';print_r($result);
curl_close($ch);
/***************************************************************************************/
function&send($ch,$data){
&&&&curl_setopt&($ch,&CURLOPT_URL,&$url);
&&&&curl_setopt($ch,&CURLOPT_POSTFIELDS,&http_build_query($data));
&&&&return&curl_exec($ch);
?&想查看更多语言(java、c++、js)短信接口示例,点击:
现在注册,即享新手专属礼包!
工信部核准SP资质,移动、电信、联通金牌合作伙伴
明码标价不欺瞒客户,坚决抵制扣量、漏发等行为
所有客户信息严格保密,保护客户信息免遭外泄
专业团队提供免费技术支持,7X24小时售后服务
地址:上海徐汇区龙华中路596号绿地中心A座6层
打开微信公众号扫一扫
· 接收账户异常报警
· 消费账单随时查
· 活动及最新平台信息实现发送短信验证码后60秒倒计时 - 开源中国社区
当前访客身份:游客 [
当前位置:
发布于 日 17时,
测试代码,请直接复制到这里http://www.w3cschool.cc/try/try.php?filename=tryjquery_hide测试【重要更新】:非常感谢有人看得起,收藏了这段代码,不过后来发现这段代码在页面刷新后,倒计时就失效了,所以改正后又分享了无视页面刷新的代码,请移步这里http://www.oschina.net/code/snippet_11
代码片段(1)
1.&[代码][HTML]代码&&&&
&!DOCTYPE html&
&script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"&&/script&
&script type="text/javascript"&
var countdown=60;
function settime(obj) {
if (countdown == 0) {
obj.removeAttribute("disabled");
obj.value="免费获取验证码";
countdown = 60;
obj.setAttribute("disabled", true);
obj.value="重新发送(" + countdown + ")";
countdown--;
setTimeout(function() {
settime(obj) }
&input type="button" id="btn" value="免费获取验证码" onclick="settime(this)" /&
开源中国-程序员在线工具:
相关的代码(530)
0回/2505阅
0回/1230阅
1回/1244阅
简单粗暴精悍
2楼:梦想岛 发表于
3楼:lxyAtSH 发表于
引用来自“梦想岛”的评论f5就破了怎么防止嘞
4楼:梦想岛 发表于
引用来自“梦想岛”的评论f5就破了引用来自“lxyAtSH”的评论怎么防止嘞当然要结合程序来判断了。用户提交的时候,生成个记录,并记录提交时间。
5楼:果然没注册 发表于
引用来自“梦想岛”的评论f5就破了确实是这样,后来就结合cookie了
6楼:huohuo1589 发表于
引用来自“梦想岛”的评论f5就破了引用来自“果然没注册”的评论确实是这样,后来就结合cookie了清cookie呢
7楼:最初的-梦想 发表于
引用来自“梦想岛”的评论f5就破了引用来自“果然没注册”的评论确实是这样,后来就结合cookie了引用来自“huohuo1589”的评论清cookie呢本来就是防止一般客户连续获取的,当然后台在判断下上次发送验证码时间不久行了
8楼:小小phper 发表于
放在cache里面
9楼:果然没注册 发表于
引用来自“梦想岛”的评论f5就破了引用来自“果然没注册”的评论确实是这样,后来就结合cookie了引用来自“huohuo1589”的评论清cookie呢这个功能本就是防君子,不防小人的.再者,一般用户是不知道怎么清除cookie的,也不经常使用.还有就是有些购物网站对于未登录用户的购物车内容也是保存于cookie中,你也不能说,你去清cookie后还赖人家网站不给你保存购物车数据呀
开源从代码分享开始
果然没注册的其它代码售前咨询:400-993-8078 &售后服务:153-
京ICP备号 &&&& &京公安网备
增值电信业务经营许可证:B2-
电信与信息服务业务经营许可证:京ICP证120252
地址:北京市朝阳区建国门外大街2号建外soho7号楼15层
版权所有:北京华兴软通科技有限公司
传&&&&&&&真:010-发验证码平台如何提交到巴卜短信平台?_百度知道
发验证码平台如何提交到巴卜短信平台?
我有更好的答案
直接对接到巴卜短信平台就可以了。

采纳率:52%
为您推荐:
其他类似问题
您可能关注的内容
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。但行好事 莫问前程
php手机短信接口发送验证码
SMS.CN的短信接口
发送验证码
&!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&
xmlns="http://www.w3.org/1999/xhtml"&
http-equiv="Content-Type" content="text/ charset=utf-8" /&
&短信模块&
type="text/css"&
font-size: 12px;
font-family: 微软雅黑;
.number{ height:22px; line-height:22px;font-family: 微软雅黑;}
language="JavaScript" type="text/javascript" src="js_yz.js"&&
id="feedbackform" name="feedbackform" action="" method="post" &
width="501" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC" style="margin-top:50"&
width="133" height="45" bgcolor="#FAFAFA" style="padding-left:10"&获取短信验证码:&
width="365" height="45" bgcolor="#FAFAFA" style="padding-left:10"& name="scms_gettel" id="scms_gettel" class="number" type="text" value="" /&
name="right_yzcode" id="right_yzcode" type="hidden" value="" /&
name="Submitbfs" type="button" value="获取验证码" class="btn submit" id="Submitbfs" onclick="giveduanxin(document.getElementById('scms_gettel').value)" style="height:28"/&&
height="45" bgcolor="#FAFAFA" style="padding-left:10"&您收到的验证码:&
height="45" bgcolor="#FAFAFA" style="padding-left:10"& type="text" name="scms_yzcode" id="scms_yzcode" class="number" value="" maxlength="6" onblur="giveyz(document.getElementById('scms_yzcode').value)" style="float:left" /& id="show_statu" style=" float:font-size:12 text-align: border:1px solid #FFCC00; line-height:25 background:#FFFFCC; color:#333333; display: height:25 padding-left:10 margin-left:8"&&&
function qingkong(){
updateinfo();
var wait = 90;
function updateinfo(){
if(wait == 0){
document.getElementById('Submitbfs').value = "获取验证码";
document.getElementById('Submitbfs').disabled="";
document.getElementById("show_statu").style.display='none';
document.getElementById('Submitbfs').disabled="disabled";
document.getElementById('Submitbfs').value = "等待 "+wait+" 秒";
setTimeout("updateinfo()",1000);
function giveyz(scms_yzcode)
var chk=true;
var divid=document.getElementById("show_statu");
var regex=/[0-9]$/
divid.style.display='block';
if (scms_yzcode=="" ){
divid.innerHTML="&span style='color:red'&请填写您收到的短信校验码!&/span&";
}else if ( document.getElementById('right_yzcode').value!=scms_yzcode ){
divid.innerHTML="&span style='color:red'&您填写的短信校验码不正确!&/span&";
}else if ( document.getElementById('right_yzcode').value==scms_yzcode ){
divid.innerHTML="&span style='color:green'&验证成功!&/span&";
var xmlHttp
function giveduanxin(tel)
var chk=true;
var divid=document.getElementById("show_statu");
var regex=/^(?:13\d|15\d|18[])-?\d{5}(\d{3}|\*{3})$/;
divid.style.display='';
if (tel=="" ){
divid.innerHTML="&span style='color:red'&请填写手机号码!&/span&";
}else if ( !regex.exec(tel) ){
divid.innerHTML="&span style='color:red'&手机号码格式不正确!&/span&";
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
alert ("抱歉,浏览器不支持")
var url="http://localhost/mcode/yz_send.php"
url=url+"?action=chk&tel="+tel
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
function stateChanged()
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
var give_strs= new Array();
give_strs=xmlHttp.responseText.split("|");
if (give_strs[0]=="right"){
divid.innerHTML="&span style='color:green'&验证码已发送,请查收!&/span&";
document.getElementById('Submitbfs').disabled="disabled";
document.getElementById('right_yzcode').value=give_strs[1];
setTimeout("qingkong()",2000);
divid.innerHTML=xmlHttp.responseT
function GetXmlHttpObject(){
var xmlHttp=null;
xmlHttp=new XMLHttpRequest();
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
return xmlH
yz_send.php
$action=$_REQUEST['action'];
$tel=$_REQUEST['tel'];
$yzm=$_REQUEST['yzm'];
function randomkeys($length){
$pattern='';
for($i=0;$i&$length;$i++){
$key.=$pattern{mt_rand(0,9)};
return $key;
function give_ms($yzm,$tel){
file_get_contents("http://api.sms.cn/mt/?uid=xxxxx&pwd=".md5(xxxxxxx)."&mobile=".$tel."&mobileids=&content=".$msg."");
$yzm=randomkeys(6);
if ($action=="chk"){
if ($tel=="" || $yzm=="" ){
"短信验证码发送失败!";
$outstrs = iconv('GBK','UTF-8',$instrs);
echo $outstrs;
if($tel == true){
$db = require('../caches/configs/database.php');
$con_arr = $db['default'];
$conn=mysql_connect($con_arr['hostname'],$con_arr['username'],$con_arr['password']) or die("error connecting") ;
mysql_query("set names 'utf8'");
mysql_select_db($con_arr['database']);
$tablename = $con_arr['tablepre'].'guestbook';
$sql ="select * from $tablename where leave_tell = ".$tel;
$result = mysql_query($sql,$conn);
$res = mysql_fetch_row($result);
if(!empty($res) && $res == true){
"您的手机号已经注册过!";
$outstr = iconv('GBK','UTF-8',$instr);
echo $outstr;
give_ms($yzm,$tel);
echo "right|".$yzm;
没有更多推荐了,
加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!

我要回帖

更多关于 免费手机号接收验证码 的文章

 

随机推荐