|
![]() | 作者: dodo [janaskiter]
![]() |
登录 |
下面的程序是接收用户提交的名字和密码并保存在数据库中,然后我想实现 返回给用户一个页面 页面里面包括提交的用户名和密码. <body> <% set myconnection=server.createobject("ADODB.Connection") myconnection.open"dsn=mydatabase;uid=admin;pwd=admin" set mycommand=server.createobject("ADODB.Command") Mycommand.commandtype=1 Mycommand.commandtext="insert into mytable (userid,password) values('"&request.form("userid")&"','"&request.form("password")&"')" set Mycommand.activeconnection=Myconnection Mycommand.Execute set Myconnection=nothing set Mycommand=nothing %> 想在下面返回个页面是 <form name=login action=http://xxx.com/relogin.asp method=post> <input type=submit value="点击这里进入"> <input type=hidden name=user value=""> 在这里想要让value=上面request.form("user")的用户 <input type=hidden name=pass value="">'在这里想要让value=equest.form("password")的密码 asp支持这样子返回方式吗,我试验了好多次都不成功 难道要用cgi来实现这样的功能吗? |
地主 发表时间: 04-03-14 16:21 |
![]() | 回复: ghost [nwghost] ![]() |
登录 |
用session就可以了, 在set myconnection=server.createobject("ADODB.Connection")之前 session("userid")=trim(request("userid")) session("password")=trim(request("password")) 然後在你要返回的��面: <input type=hidden name=user value="<% response.write session("userid") %>"> <input type=hidden name=pass value="<% response.write session("password") %>"> 然後可以清空也可以不清空session session("userid")="" session("password")="" [此贴被 ghost(nwghost) 在 03月15日10时21分 编辑过] |
B1层 发表时间: 04-03-15 10:19 |
![]() | 回复: dodo [janaskiter] ![]() |
登录 |
非常感谢ghost :) |
B2层 发表时间: 04-03-15 14:14 |
|
20CN网络安全小组版权所有
Copyright © 2000-2010 20CN Security Group. All Rights Reserved.
论坛程序编写:NetDemon
粤ICP备05087286号