登陆过程:
输入密码后按回车键网页将调用javascript写的检查密码函数来检查密码是否符合格式要求(此网站登陆密码必须为8位),如果符合条件取得客户端标识(网站每个用户都有一张ic卡),如果客户端标识正确则以get方式向服务器传递加密以后的客户标识。
我想问我应该怎样才能将密码传递给检验密码的函数
4 个解决方案
#1
网页源码
<SCRIPT LANGUAGE=javascript>
<!--
var cPw=new Array("0","1","2","3","4","5","6","7","8"); //密码组
var Max=8;
var userPassWD="";
function checkPwd() {
if (txtPd.value==""){
alert("您输入的口令不能为空!");
txtPd.focus();
return;
}
for(i=0;i<=Max;i++)
if (txtPd.value==cPw[i]){
alert("请输入 8 位IC卡口令!");
//userPassWD = "88888888";
//identityVerifyFirst("pub/index.htm");
return true
}
userPassWD = txtPd.value;
identityVerifyFirst("pub/index.htm");
//alert("您输入的密码不对!");
//txtPd.focus();
//return false;
}
function txtPd_onkeypress() {
if (window.event.keyCode==13)
checkPwd();
}
//-->
</SCRIPT>
<body topmargin=10 bgcolor=000080>
<TABLE WIDTH=98% BORDER=0 CELLSPACING=0 CELLPADDING=0 align="center">
<TR>
<TD width=10%></TD>
<TD align=center>
<TABLE WIDTH=91% BORDER=0 CELLSPACING=0 CELLPADDING=0>
<TR>
<TD><hr noshade color=White size=1></TD>
</TR>
<TR>
<TD><hr noshade color=White size=1></TD>
</TR>
<TR>
<TD align=center>
<TABLE WIDTH=570 BORDER=0 CELLSPACING=1 CELLPADDING=0>
<TR><TD WIDTH=100>
<font class=p9>请输入口令:</font>
</TD>
<TD WIDTH=100>
<input type="password" id="txtPd" class="txt" maxlength=8 LANGUAGE=javascript onkeypress="return txtPd_onkeypress()">
</TD>
<TD>
<img src="images/yes.gif" border="0" style="cursor:hand" onclick="return checkPwd()";">
</TD>
<!--<TD>
<img src="images/new.gif" border="0">
</TD>
-->
<TD style="font-size:9pt">
<a href="portHelp.htm" target="_blank" title=最新更新日期20031024> 常见问题解答</a>
</TD>
<TD>
</TD>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TR>
<TD><hr noshade color=White size=1></TD>
</TR>
<TR>
<TD class=p10>
请您按照以下步骤进行: <br>
1、请先插入IC卡。<br>
2、在输入框中输入密码。<br>
</TD>
</TR>
<TR>
<TD><hr noshade color=White size=1></TD>
</TR>
<TR>
<TD align=center>
<br>
<table align="center">
<tr>
<td>
</td>
</tr>
</table>
</tr>
<tr>
<TD align=center>
<div align="center" height="0">
<input type="hidden" id="cUserID"> <!--客户标识 //-->
<input type="hidden" id="cRndPEMstr"> <!--客户端随机数 //-->
<input type="hidden" id="cRndPEMstrLen"> <!--客户端随机数长度 //-->
<input type="hidden" id="sRndPEMstr">
<input type="hidden" id="sRndPEMstrLen">
<input type="hidden" id="RSAPEMstr">
<input type="hidden" id="RSAPEMstrLen">
<input type="hidden" id="CertPEMstr">
<input type="hidden" id="CertPEMstrLen">
<input type="hidden" id="nRet">
<input type="hidden" id="nRetStr">
<input type="hidden" id="ca_verify">
<input type="hidden" id="strRandom">
<input type="hidden" id="certSeqNo1">
<OBJECT classid="clsid:16F2448E-8C16-11D1-9A11-0080C8E1561F" height=14 id=caOcx style="LEFT: 0px; TOP: 0px; VISIBILITY: hidden"
width=14 border="0">
<PARAM NAME="_ExtentX" VALUE="370">
<PARAM NAME="_ExtentY" VALUE="370"></OBJECT>
</div>
</TD>
</TR>
</TABLE>
</TD>
<TD width=8% > </TD>
</TR>
</TABLE>
</body><SCRIPT language=javascript>
<SCRIPT LANGUAGE=javascript>
<!--
var cPw=new Array("0","1","2","3","4","5","6","7","8"); //密码组
var Max=8;
var userPassWD="";
function checkPwd() {
if (txtPd.value==""){
alert("您输入的口令不能为空!");
txtPd.focus();
return;
}
for(i=0;i<=Max;i++)
if (txtPd.value==cPw[i]){
alert("请输入 8 位IC卡口令!");
//userPassWD = "88888888";
//identityVerifyFirst("pub/index.htm");
return true
}
userPassWD = txtPd.value;
identityVerifyFirst("pub/index.htm");
//alert("您输入的密码不对!");
//txtPd.focus();
//return false;
}
function txtPd_onkeypress() {
if (window.event.keyCode==13)
checkPwd();
}
//-->
</SCRIPT>
<body topmargin=10 bgcolor=000080>
<TABLE WIDTH=98% BORDER=0 CELLSPACING=0 CELLPADDING=0 align="center">
<TR>
<TD width=10%></TD>
<TD align=center>
<TABLE WIDTH=91% BORDER=0 CELLSPACING=0 CELLPADDING=0>
<TR>
<TD><hr noshade color=White size=1></TD>
</TR>
<TR>
<TD><hr noshade color=White size=1></TD>
</TR>
<TR>
<TD align=center>
<TABLE WIDTH=570 BORDER=0 CELLSPACING=1 CELLPADDING=0>
<TR><TD WIDTH=100>
<font class=p9>请输入口令:</font>
</TD>
<TD WIDTH=100>
<input type="password" id="txtPd" class="txt" maxlength=8 LANGUAGE=javascript onkeypress="return txtPd_onkeypress()">
</TD>
<TD>
<img src="images/yes.gif" border="0" style="cursor:hand" onclick="return checkPwd()";">
</TD>
<!--<TD>
<img src="images/new.gif" border="0">
</TD>
-->
<TD style="font-size:9pt">
<a href="portHelp.htm" target="_blank" title=最新更新日期20031024> 常见问题解答</a>
</TD>
<TD>
</TD>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TR>
<TD><hr noshade color=White size=1></TD>
</TR>
<TR>
<TD class=p10>
请您按照以下步骤进行: <br>
1、请先插入IC卡。<br>
2、在输入框中输入密码。<br>
</TD>
</TR>
<TR>
<TD><hr noshade color=White size=1></TD>
</TR>
<TR>
<TD align=center>
<br>
<table align="center">
<tr>
<td>
</td>
</tr>
</table>
</tr>
<tr>
<TD align=center>
<div align="center" height="0">
<input type="hidden" id="cUserID"> <!--客户标识 //-->
<input type="hidden" id="cRndPEMstr"> <!--客户端随机数 //-->
<input type="hidden" id="cRndPEMstrLen"> <!--客户端随机数长度 //-->
<input type="hidden" id="sRndPEMstr">
<input type="hidden" id="sRndPEMstrLen">
<input type="hidden" id="RSAPEMstr">
<input type="hidden" id="RSAPEMstrLen">
<input type="hidden" id="CertPEMstr">
<input type="hidden" id="CertPEMstrLen">
<input type="hidden" id="nRet">
<input type="hidden" id="nRetStr">
<input type="hidden" id="ca_verify">
<input type="hidden" id="strRandom">
<input type="hidden" id="certSeqNo1">
<OBJECT classid="clsid:16F2448E-8C16-11D1-9A11-0080C8E1561F" height=14 id=caOcx style="LEFT: 0px; TOP: 0px; VISIBILITY: hidden"
width=14 border="0">
<PARAM NAME="_ExtentX" VALUE="370">
<PARAM NAME="_ExtentY" VALUE="370"></OBJECT>
</div>
</TD>
</TR>
</TABLE>
</TD>
<TD width=8% > </TD>
</TR>
</TABLE>
</body><SCRIPT language=javascript>
#2
up
#3
各位给点意见呀!
#4
怎么没有人回答呢
是都不会吗
是都不会吗
#1
网页源码
<SCRIPT LANGUAGE=javascript>
<!--
var cPw=new Array("0","1","2","3","4","5","6","7","8"); //密码组
var Max=8;
var userPassWD="";
function checkPwd() {
if (txtPd.value==""){
alert("您输入的口令不能为空!");
txtPd.focus();
return;
}
for(i=0;i<=Max;i++)
if (txtPd.value==cPw[i]){
alert("请输入 8 位IC卡口令!");
//userPassWD = "88888888";
//identityVerifyFirst("pub/index.htm");
return true
}
userPassWD = txtPd.value;
identityVerifyFirst("pub/index.htm");
//alert("您输入的密码不对!");
//txtPd.focus();
//return false;
}
function txtPd_onkeypress() {
if (window.event.keyCode==13)
checkPwd();
}
//-->
</SCRIPT>
<body topmargin=10 bgcolor=000080>
<TABLE WIDTH=98% BORDER=0 CELLSPACING=0 CELLPADDING=0 align="center">
<TR>
<TD width=10%></TD>
<TD align=center>
<TABLE WIDTH=91% BORDER=0 CELLSPACING=0 CELLPADDING=0>
<TR>
<TD><hr noshade color=White size=1></TD>
</TR>
<TR>
<TD><hr noshade color=White size=1></TD>
</TR>
<TR>
<TD align=center>
<TABLE WIDTH=570 BORDER=0 CELLSPACING=1 CELLPADDING=0>
<TR><TD WIDTH=100>
<font class=p9>请输入口令:</font>
</TD>
<TD WIDTH=100>
<input type="password" id="txtPd" class="txt" maxlength=8 LANGUAGE=javascript onkeypress="return txtPd_onkeypress()">
</TD>
<TD>
<img src="images/yes.gif" border="0" style="cursor:hand" onclick="return checkPwd()";">
</TD>
<!--<TD>
<img src="images/new.gif" border="0">
</TD>
-->
<TD style="font-size:9pt">
<a href="portHelp.htm" target="_blank" title=最新更新日期20031024> 常见问题解答</a>
</TD>
<TD>
</TD>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TR>
<TD><hr noshade color=White size=1></TD>
</TR>
<TR>
<TD class=p10>
请您按照以下步骤进行: <br>
1、请先插入IC卡。<br>
2、在输入框中输入密码。<br>
</TD>
</TR>
<TR>
<TD><hr noshade color=White size=1></TD>
</TR>
<TR>
<TD align=center>
<br>
<table align="center">
<tr>
<td>
</td>
</tr>
</table>
</tr>
<tr>
<TD align=center>
<div align="center" height="0">
<input type="hidden" id="cUserID"> <!--客户标识 //-->
<input type="hidden" id="cRndPEMstr"> <!--客户端随机数 //-->
<input type="hidden" id="cRndPEMstrLen"> <!--客户端随机数长度 //-->
<input type="hidden" id="sRndPEMstr">
<input type="hidden" id="sRndPEMstrLen">
<input type="hidden" id="RSAPEMstr">
<input type="hidden" id="RSAPEMstrLen">
<input type="hidden" id="CertPEMstr">
<input type="hidden" id="CertPEMstrLen">
<input type="hidden" id="nRet">
<input type="hidden" id="nRetStr">
<input type="hidden" id="ca_verify">
<input type="hidden" id="strRandom">
<input type="hidden" id="certSeqNo1">
<OBJECT classid="clsid:16F2448E-8C16-11D1-9A11-0080C8E1561F" height=14 id=caOcx style="LEFT: 0px; TOP: 0px; VISIBILITY: hidden"
width=14 border="0">
<PARAM NAME="_ExtentX" VALUE="370">
<PARAM NAME="_ExtentY" VALUE="370"></OBJECT>
</div>
</TD>
</TR>
</TABLE>
</TD>
<TD width=8% > </TD>
</TR>
</TABLE>
</body><SCRIPT language=javascript>
<SCRIPT LANGUAGE=javascript>
<!--
var cPw=new Array("0","1","2","3","4","5","6","7","8"); //密码组
var Max=8;
var userPassWD="";
function checkPwd() {
if (txtPd.value==""){
alert("您输入的口令不能为空!");
txtPd.focus();
return;
}
for(i=0;i<=Max;i++)
if (txtPd.value==cPw[i]){
alert("请输入 8 位IC卡口令!");
//userPassWD = "88888888";
//identityVerifyFirst("pub/index.htm");
return true
}
userPassWD = txtPd.value;
identityVerifyFirst("pub/index.htm");
//alert("您输入的密码不对!");
//txtPd.focus();
//return false;
}
function txtPd_onkeypress() {
if (window.event.keyCode==13)
checkPwd();
}
//-->
</SCRIPT>
<body topmargin=10 bgcolor=000080>
<TABLE WIDTH=98% BORDER=0 CELLSPACING=0 CELLPADDING=0 align="center">
<TR>
<TD width=10%></TD>
<TD align=center>
<TABLE WIDTH=91% BORDER=0 CELLSPACING=0 CELLPADDING=0>
<TR>
<TD><hr noshade color=White size=1></TD>
</TR>
<TR>
<TD><hr noshade color=White size=1></TD>
</TR>
<TR>
<TD align=center>
<TABLE WIDTH=570 BORDER=0 CELLSPACING=1 CELLPADDING=0>
<TR><TD WIDTH=100>
<font class=p9>请输入口令:</font>
</TD>
<TD WIDTH=100>
<input type="password" id="txtPd" class="txt" maxlength=8 LANGUAGE=javascript onkeypress="return txtPd_onkeypress()">
</TD>
<TD>
<img src="images/yes.gif" border="0" style="cursor:hand" onclick="return checkPwd()";">
</TD>
<!--<TD>
<img src="images/new.gif" border="0">
</TD>
-->
<TD style="font-size:9pt">
<a href="portHelp.htm" target="_blank" title=最新更新日期20031024> 常见问题解答</a>
</TD>
<TD>
</TD>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TR>
<TD><hr noshade color=White size=1></TD>
</TR>
<TR>
<TD class=p10>
请您按照以下步骤进行: <br>
1、请先插入IC卡。<br>
2、在输入框中输入密码。<br>
</TD>
</TR>
<TR>
<TD><hr noshade color=White size=1></TD>
</TR>
<TR>
<TD align=center>
<br>
<table align="center">
<tr>
<td>
</td>
</tr>
</table>
</tr>
<tr>
<TD align=center>
<div align="center" height="0">
<input type="hidden" id="cUserID"> <!--客户标识 //-->
<input type="hidden" id="cRndPEMstr"> <!--客户端随机数 //-->
<input type="hidden" id="cRndPEMstrLen"> <!--客户端随机数长度 //-->
<input type="hidden" id="sRndPEMstr">
<input type="hidden" id="sRndPEMstrLen">
<input type="hidden" id="RSAPEMstr">
<input type="hidden" id="RSAPEMstrLen">
<input type="hidden" id="CertPEMstr">
<input type="hidden" id="CertPEMstrLen">
<input type="hidden" id="nRet">
<input type="hidden" id="nRetStr">
<input type="hidden" id="ca_verify">
<input type="hidden" id="strRandom">
<input type="hidden" id="certSeqNo1">
<OBJECT classid="clsid:16F2448E-8C16-11D1-9A11-0080C8E1561F" height=14 id=caOcx style="LEFT: 0px; TOP: 0px; VISIBILITY: hidden"
width=14 border="0">
<PARAM NAME="_ExtentX" VALUE="370">
<PARAM NAME="_ExtentY" VALUE="370"></OBJECT>
</div>
</TD>
</TR>
</TABLE>
</TD>
<TD width=8% > </TD>
</TR>
</TABLE>
</body><SCRIPT language=javascript>
#2
up
#3
各位给点意见呀!
#4
怎么没有人回答呢
是都不会吗
是都不会吗