文本的问题

yufang 2003-10-09 11:44:13
password.txt中的内容是
rrr
888
怎么才能把request.form("username")和request.form("password")分别对应rrr和888
我下面的程序能对应一个
两个对应我就不会做了

<%if request.form="" then%>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><table width="600" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#6A4000">
<tr>
<td><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/index1.jpg" width="600" height="244"></td>
</tr>
<tr>
<td height="181" background="images/index2.jpg"><form name="form1" method="post" action="index.asp">
<table width="200" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td width="40"><div align="center">用户:</div></td>
<td><div align="right">
<input name="username" type="text" id="username">
</div></td>
</tr>
<tr>
<td><div align="center">密码:</div></td>
<td><div align="right">
<input name="password" type="text" id="password">
</div></td>
</tr>
<tr>
<td> </td>
<td><div align="center"><input type="image" src='images/buttom.gif'></div></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<%else
set fso=server.createobject("scripting.filesystemobject")
pf=server.mapPath("password.txt")
set sto=fso.opentextfile(pf,1)
'do until sto.atendofstream
pass=server.htmlencode(sto.readline)
'loop
if request.form("password")=pass then
response.write pass
else
response.write request.form("password")
end if
end if%>
...全文
34 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
angelheavens 2003-10-09
  • 打赏
  • 举报
回复
<%
dim username,password,pass1

username=trim(request.form("username"))
password=trim(request.form("password"))

pass1=username&chr(13)&chr(10)&password

set fso=server.createobject("scripting.filesystemobject")
pf=server.mapPath("password.txt")
set sto=fso.opentextfile(pf,1)
pass=trim(server.htmlencode(sto.readALL))
if instr(pass,pass1)>0 then
response.write pass
end if
%>

<!--(如果有疑问,请发短信息来相互讨论)-->
angelheavens 2003-10-09
  • 打赏
  • 举报
回复
<%
pass1="rrr"&chr(13)&chr(10)&"888"
set fso=server.createobject("scripting.filesystemobject")
pf=server.mapPath("password.txt")
set sto=fso.opentextfile(pf,1)
pass=trim(server.htmlencode(sto.readALL))
if instr(pass,pass1)>0 then
response.write pass
end if
%>

<!--(如果有疑问,请发短信息来相互讨论)-->
孟子E章 2003-10-09
  • 打赏
  • 举报
回复
fso的

readLine()
sunnyBelt 2003-10-09
  • 打赏
  • 举报
回复
为何不把这些内容放到数据库里面去?不但安全而且检索起来也方便了许多。

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧