| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1499 人关注过本帖
标题:菜鸟提问,关于网页登录。
只看楼主 加入收藏
chengxc
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2017-9-11
收藏
 问题点数:0 回复次数:1 
菜鸟提问,关于网页登录。
在网页上输入用户名、密码和验证码后点登录可登录设备。
请教各位大神:下面是网页的html和js代码,请问我该如何通过HttpReq.Open "POST",url & "/xml?method=.................."这样的格式来实现登录功能(我是菜鸟,请具体点)。谢谢啦!

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<script language="javascript" src="md5.js"></script>
<script language="JavaScript">
var RandomString="7938";

var ShowCode=1;
if(self!=top)
{
    top.location=self.location;
    }
var Lang = "zhcn";
var str1;
var str2;
var trcode;
var subed=false;
var oldpass;
function init()
{
    document.getElementById("img_rdm").setAttribute("src","rdm.bmp?ver="+RandomString);
    document.getElementById("toplogo").setAttribute("src","topLogo.gif?ver="+RandomString);
    trcode=document.getElementById("tr_code");
    if(ShowCode==0)
        tr_code.style.display="none";
    document.getElementById('name').focus();
    if(Lang=="en")
    {
        document.getElementById("i3").src="Login_en_03.gif";
        document.getElementById("i5").src="Login_en_05.gif";
        document.getElementById("i7").src="Login_en_07.gif";
        document.getElementById("i9").src="Login_en_09.gif";
        document.cookie="language=en; path=/";
        document.title="Login";
        str1="Code:";
        str2="Please input the code!";
            }
    else
    {
        document.getElementById("i3").src="Login_03.gif";
        document.getElementById("i5").src="Login_05.gif";
        document.getElementById("i7").src="Login_07.gif";
        document.getElementById("i9").src="Login_09.gif";
        document.cookie="language=zhcn; path=/";
        document.title="登录";
        str1="验证码:";
        str2="请输入验证码!";
            }
    document.getElementById("s").innerHTML=str1;
    }
function login()
{
    var psw=document.getElementById("psw"),rdm=document.getElementById("rdm");
    var ss;
    if(ShowCode==1)
    {
        if(rdm.value=="")
        {
            alert(str2);
            str2.focus();
            return;
                    }
        if(subed==false)
        {
            ss=psw.value+rdm.value;
            oldpass=psw.value;
            subed=true;
                    }
        else
        {
            ss=oldpass+rdm.value;
            subed=false;
                    }
            }
    else
    {
        if(subed==false)
        {
            ss=psw.value;
            oldpass=psw.value;
            subed=true;
                    }
        else
        {
            ss=oldpass;
            subed=false;
                    }
            }
    psw.value=hex_md5(ss);
    document.getElementById('formLogin').submit();
    }
</script>
<style type="text/css">
.styleHere {
    border-left: #636563 1px solid;
    border-right: #636563 1px solid;
    border-bottom: #636563 1px solid;
    background-color: #EFEFEF;
}
</style>
</head>
<body onLoad="init();" onkeydown="if(event.keyCode==13) login();">
<div align="center">
<table width="950" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="60" valign="middle"><img id="toplogo" src="topLogo.gif" width="950" height="60" border="0" usemap="#Map"></td>
</tr>
<form name="formChinese" id="formChinese" method="post" action=/cgi-bin/Form_ChangeLanguage>
<input type="hidden" name="Sel_Language" value="1">
</form>
<form name="formEnglish" id="formEnglish" method="post" action=/cgi-bin/Form_ChangeLanguage>
<input type="hidden" name="Sel_Language" value="0">
</form>
<tr>
<td align="center" valign="middle" class="styleHere">
<form name="formLogin" id="formLogin" method="post" target="_top" action=/cgi-bin/userLogin>
<table>
<tr>
<td colspan="2"><IMG SRC="Login_03.gif" id="i3"></td>
</tr>
<tr>
<td width="81"><IMG SRC="Login_05.gif" id="i5"></td>
<td width="216" valign="bottom"><input class="login" name="name" type="text" id="name" style="width:150px"></td>
</tr>
<tr>
<td><IMG SRC="Login_07.gif" id="i7"></td>
<td valign="bottom"><input class="login" name="psw" type="password" id="psw"  style="width:150px"></td>
</tr>
<tr id="tr_code">
<td height="40"></td>
<td valign="bottom"><input class="login" name="rdm" type="text" id="rdm"  style="width:60px">&nbsp;&nbsp;<font style="color:#333333;" size="2" id="s"></font><img id="img_rdm" src="rdm.bmp" border="0"></td>
</tr>
<tr>
<td colspan="2"><img src="Login_09.gif" border="0" usemap="#Map2" id="i9">
<map name="Map2">
<area shape="rect" coords="79,14,121,33" href="javascript:login();">
<area shape="rect" coords="125,15,167,32" href="javascript:document.getElementById('formLogin').reset()">
</map></td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td colspan="2" class="cpyRight"></td>
</tr>
</table>
</div>
<map name="Map">
<area shape="rect" coords="889,18,949,38" href="javascript:document.getElementById('formEnglish').submit()">
<area shape="rect" coords="889,0,949,20" href="javascript:document.getElementById('formChinese').submit()">
</map>
</body>
</html>
搜索更多相关主题的帖子: var document getElementById gif name 
2017-09-11 14:16
wlrjgzs
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:26
帖 子:212
专家分:1566
注 册:2017-4-10
收藏
得分:0 
这个要具体的话,恐怕要留下你的扣扣或者微信。
2017-09-22 15:10
快速回复:菜鸟提问,关于网页登录。
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.028212 second(s), 11 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved