新手求教,链接传值,同时表单赋值如何实现
请高手帮忙,有关ASP链接传值和表单提交的问题通过链接传电话号码至一个页面,同时链接打开这个页面后,填写短信内容表单,提交后将电话和内容发到接口地址
但修改发现传值无法进入SUB进程,但在SUB进程赋值可行
以下是原来可以直接填写电话和内容的页面,现在需链接传值和表单填写
<%
if request("m")="send" then
sendsms trim(replace(request("mobile"),",",",")),trim(request("msg"))
else
%>
<form name=form1 method=post action="?m=send" onSubmit="if(this.mobile.value==''){alert('输入接收手机号码');this.mobile.focus();return false}">
手机号:<input type=text name=mobile>*多个手机号之间用“,”分隔<br>
内 容:<textarea name=msg cols=30 rows=4>HTTP接口发送演示</textarea><br><br>
<input type=submit value="发送" id=submit1 name=submit1><br>
</form>
<%
end if
%>
</body>
</html>
<%
Sub sendsms(mobile,msg)
'多个手机号之间用“,”分隔
dim userid,password,status
dim xmlObj,httpsendurl
userid = "9999" '企业ID,请联系我们索取免费测试帐号
password = "2754tr43f38c60f8b44f1cf620d684ab" 'ID密码,要使用MD5加密为32位密文并转换为小写
httpsendurl="http://http.(msg)
set xmlObj = server.CreateObject("Microsoft.XMLHTTP")
xmlObj.Open "GET",httpsendurl,false
xmlObj.send()
status = xmlObj.responseText
set xmlObj = nothing
if status = "100" then '发送成功
Response.Write "发送成功! <a href=""javascript:history.back();"">返回</a>"
else '发送失败
Response.Write "发送失败!<a href=""javascript:history.back();"">返回</a>"
end if
End sub
%>