注册 登录
编程论坛 ASP技术论坛

如何不提交表单,把文本框值直接赋给Session("text")

link113 发布于 2013-01-09 20:06, 463 次点击
如何不提交表单,把文本框值直接赋给Session("text")  ,网络上都是JS的方法,可是JS获取的文本框值不能等于Session。。。其实就是想做个加密数据的ASP程序,POST和GET数据提交都不安全,直接就被抓包了。所以想用Session。。
1 回复
#2
ysf01812013-01-10 11:38
function checkid(touxian){   
    //alert(regid);
    var xmlhttp;
    try{
        xmlhttp=new XMLHttpRequest();
        }
    catch(e){
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
    xmlhttp.onreadystatechange=function(){
    if (xmlhttp.readyState==4){
        if (xmlhttp.status==200){
            var data = xmlhttp.responseText;
            
            if(data == 1){
            document.getElementById("touxian1").innerHTML = "<img src='images/yesno.gif'  border='0 'align='absmiddle'/>测试";
            }
                //id_result(data);
            //alert(data);
        }
        else{
            //$("span")[0].innerHTML="用户名检测失败,请联系管理员";
            }
        }
    else{
        //alert(1111);
        //$("span")[0].innerHTML="正在进行用户名校验...";
        }
    }//xmlhttp.onreadystatechange=function(){
    xmlhttp.open("post", "zhaopin.asp", true);
    xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
    xmlhttp.send("touxian="+escape(touxian));
}
////////
</script>

zhaopin.asp页面:
<%
data = 0
touxian = request("touxian")
response.write data
%>
其他你自己调试。项目合作:461840539
1