response.Redirect问题。

lesyi 2004-07-22 03:29:21
我用response.Redirect传到其它页,为什么地址栏里要有:127.0.0.1/indes.asp
如果没有/index.asp,就会出现错误,找不到网页。
...全文
129 12 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
lesyi 2004-07-23
  • 打赏
  • 举报
回复
是我写错了,但也不关这个问题的事。要输入文件名才能转。
fanskojs 2004-07-22
  • 打赏
  • 举报
回复
- -!是啊!indes=index???

我也发现这个了!
IANCHAN42 2004-07-22
  • 打赏
  • 举报
回复
我用response.Redirect传到其它页,为什么地址栏里要有:127.0.0.1/indes.asp
如果没有/index.asp,就会出现错误,找不到网页。

你的文件名错了啊indes.asp=index.asp????
lesyi 2004-07-22
  • 打赏
  • 举报
回复
dim admin_name,admin_pass
admin_name=request.form("username")
admin_pass=request.form("password")
admin_pass=md5(admin_pass)
%>
<%
if admin_name<>"" and admin_pass<>"" then
sql="select * from admin order by ID desc"
Set ra = Server.CreateObject("ADODB.Recordset")
ra.open sql,conn,1,3
if not ra.eof then
if ra("username")=admin_name and ra("password")=admin_pass then
session("admin_name")=admin_name
session("admin_pass")=admin_pass
response.Redirect ("admin_index.asp")
ra.close
else
response.write("<script>alert('非法登陆!');history.go(-1)</script>")
end if
end if
else
end if
%>

出现:

无法显示网页
由于网页地址不正确,正在查找的网页无法显示。
cwjisgenius 2004-07-22
  • 打赏
  • 举报
回复
我只是顺便说说大多数时候页面转向的话用server.transfer比用response.redirect效率高
:)
把你的问题说详细点吧
报什么错,或者把程序段贴出来
lesyi 2004-07-22
  • 打赏
  • 举报
回复
有添加的呀。
用Server.Transfer这个??
cwjisgenius 2004-07-22
  • 打赏
  • 举报
回复
你缺省的首页文件没有添加index.asp吧
建议用Server.Transfer代替response.redirect转向,效率高点
lesyi 2004-07-22
  • 打赏
  • 举报
回复
文件都是在同一个目录的。
luyy1983 2004-07-22
  • 打赏
  • 举报
回复
response.redirect"将要跳转的网页名"
应该与index.asp没关系的。
morris_lz 2004-07-22
  • 打赏
  • 举报
回复
用相对路径就可以了,类似于response.redirect("../../index.asp")
shauykee 2004-07-22
  • 打赏
  • 举报
回复
不详细,贴出来瞧瞧。
mzcih 2004-07-22
  • 打赏
  • 举报
回复
代码,贴上来让大家瞧瞧。

28,409

社区成员

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

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