asp短信接口源码
来源:未知 责任编辑:责任编辑 发表时间:2013-12-01 14:19 点击:次
reg.asp文件
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>56短信网php短信接示例(http://www.56dxw.com)</title>
<script src="js/jquery.js" language="javascript" type="text/javascript"></script>
<script type="text/javascript">
function get(obj) {
var partten = /^\d{10,13}$/;
if (!partten.test(document.getElementById("t_tel").value)) {
alert('请输入正确的手机号码');
return;
}
obj.disabled = true;
$.ajax({
url: "sms.asp",
type: "Post",
data: "Tel=" + $("#t_tel").val(),
success: function(msg) {
obj.disabled = false;
if (msg == "ok") {
alert("短信已经发送成功")
return;
}
if (msg == "error") {
alert("短信发送失败")
return;
}
//alert(msg);//用来调试
}
})
}
</script>
</head>
<body>
<label>
<form id="form1" name="form1" method="post" action="reg.asp?action=add">
您手机号码:
<input name="t_tel" type="text" id="t_tel" />
<input id="Button1" type="button" value="获取验证码" onClick="get(this)" />
<br />
<br />
验证码:
<input name="t_num" type="text" id="t_num" />
</label>
<br />
<br />
<label>
<input type="submit" name="Submit" value=" 确 定 " />
</label>
</form>
<p> </p>
</body>
</html>
Sms.asp
<%
www.2cto.com
Function getHTTPPage(url)
Dim Http
Set Http = Server.CreateObject("MSXML2.XMLHTTP")
Http.Open "GET", url, False
Http.send()
If Http.readystate <> 4 Then
Exit Function
End If
getHTTPPage = BytesToBstr(Http.responseBody, "GB2312")
Set Http = Nothing
If Err.Number <> 0 Then Err.Clear
End Function
Function BytesToBstr(body, Cset)
Dim objstream
Set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode = 3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
Set objstream = Nothing
End Function
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>56短信网php短信接示例(http://www.56dxw.com)</title>
<script src="js/jquery.js" language="javascript" type="text/javascript"></script>
<script type="text/javascript">
function get(obj) {
var partten = /^\d{10,13}$/;
if (!partten.test(document.getElementById("t_tel").value)) {
alert('请输入正确的手机号码');
return;
}
obj.disabled = true;
$.ajax({
url: "sms.asp",
type: "Post",
data: "Tel=" + $("#t_tel").val(),
success: function(msg) {
obj.disabled = false;
if (msg == "ok") {
alert("短信已经发送成功")
return;
}
if (msg == "error") {
alert("短信发送失败")
return;
}
//alert(msg);//用来调试
}
})
}
</script>
</head>
<body>
<label>
<form id="form1" name="form1" method="post" action="reg.asp?action=add">
您手机号码:
<input name="t_tel" type="text" id="t_tel" />
<input id="Button1" type="button" value="获取验证码" onClick="get(this)" />
<br />
<br />
验证码:
<input name="t_num" type="text" id="t_num" />
</label>
<br />
<br />
<label>
<input type="submit" name="Submit" value=" 确 定 " />
</label>
</form>
<p> </p>
</body>
</html>
Sms.asp
<%
www.2cto.com
Function getHTTPPage(url)
Dim Http
Set Http = Server.CreateObject("MSXML2.XMLHTTP")
Http.Open "GET", url, False
Http.send()
If Http.readystate <> 4 Then
Exit Function
End If
getHTTPPage = BytesToBstr(Http.responseBody, "GB2312")
Set Http = Nothing
If Err.Number <> 0 Then Err.Clear
End Function
Function BytesToBstr(body, Cset)
Dim objstream
Set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode = 3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
Set objstream = Nothing
End Function
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>