help!!怎样才能弹出窗口??急急!!!

kkkuuu 2003-10-08 03:40:21
下面代码中,当zt=1时,怎么样修改才能弹出一个警告的窗口?

<%
user_name=Request("user_name")
'user_name="ppmm"
set rs3=server.CreateObject ("ADODB.recordset")
sql="select * from user where user_name='"&user_name&"'"
rs3.Open sql,conn1,1,3
zt=rs3("zt")
if zt=0 then
response.Redirect("sz.asp")
elseif zt=1 then
response.Redirect("zj.asp")

end if
%>
...全文
54 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
tripofdream 2003-10-08
  • 打赏
  • 举报
回复
<%
user_name=Request("user_name")
'user_name="ppmm"
set rs3=server.CreateObject ("ADODB.recordset")
sql="select * from user where user_name='"&user_name&"'"
rs3.Open sql,conn1,1,3
zt=rs3("zt")
if zt=0 then
response.Redirect("sz.asp")
elseif zt=1 then %>
<SCRIPT LANGUAGE="JavaScript">
<!--
alert("你要的弹出的对话框的内容");
window.location.href='test2.asp';

//-->
</SCRIPT>

<% end if %>
junsunchen 2003-10-08
  • 打赏
  • 举报
回复
<%
user_name=Request("user_name")
'user_name="ppmm"
set rs3=server.CreateObject ("ADODB.recordset")
sql="select * from user where user_name='"&user_name&"'"
rs3.Open sql,conn1,1,3
zt=rs3("zt")
if zt=0 then
response.Redirect("sz.asp")
elseif zt=1 then
%>
<script language="javascript">
alert("zt=1")
</script>
<%

end if
%>
swlswl27 2003-10-08
  • 打赏
  • 举报
回复
if (confirm("msg")) window.location.href="test2.asp"; //确认后要去的地方
else window.location.href="test2.asp";//取消后要去的地方
opolmzy 2003-10-08
  • 打赏
  • 举报
回复
up
minghui000 2003-10-08
  • 打赏
  • 举报
回复
<%
user_name=Request("user_name")
'user_name="ppmm"
set rs3=server.CreateObject ("ADODB.recordset")
sql="select * from user where user_name='"&user_name&"'"
rs3.Open sql,conn1,1,3
zt=rs3("zt")
if zt=0 then
response.Redirect("sz.asp")
elseif zt=1 then
response.write "<script >"&chr(13)
response.write "alert('你要的弹出的对话框的内容')"&chr(13)
response.write "</script>"&chr(13)

end if
%>
clcy 2003-10-08
  • 打赏
  • 举报
回复
<Script LANGUAGE="JavaScript">
<!--
windows.ope("popl.asp","popwindows1","height=100,width=120,top=0,
left=24,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,
status=no")
//*打开窗口pop1.asp.
window.open("pop2.asp","popwindow2","height=100,width=200,top=100,
left=144,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,
status=no")
//*打开窗口pop2.asp
</Script>

上面是弹出两个窗口
至于大小可以根据自己的要求进行改动
wangshenkai 2003-10-08
  • 打赏
  • 举报
回复
up
kkkuuu 2003-10-08
  • 打赏
  • 举报
回复
if (confirm("你要的弹出的对话框的内容"))
这里用confirm后出现的是确定和取消两个选择的对话框
按确定可以转到想去的页面,但按取消就又出现了本页面,
改为alert后只有确定按纽,但按了之后也是回到本页面,
要怎么修改才能转到自己想去的页面??
除了yrzhlgq(笑天,笑地)
的方法外??
echolwl 2003-10-08
  • 打赏
  • 举报
回复
fangpeng2003(阿房对自己说——要么No.1要么No!),他的方法很好!
UP!
fangpeng2003 2003-10-08
  • 打赏
  • 举报
回复
<%
user_name=Request("user_name")
'user_name="ppmm"
set rs3=server.CreateObject ("ADODB.recordset")
sql="select * from user where user_name='"&user_name&"'"
rs3.Open sql,conn1,1,3
zt=rs3("zt")
if zt=0 then
response.Redirect("sz.asp")
elseif zt=1 then %>
<SCRIPT LANGUAGE="JavaScript">
<!--
if (confirm("你要的弹出的对话框的内容")) {
window.location.href='test2.asp'}

//-->
</SCRIPT>

<% end if %>
lyrzhlgq 2003-10-08
  • 打赏
  • 举报
回复
response.write "alert('你要的弹出的对话框的内容')"&chr(13)
中的alert 中的按钮没有你要求的触发事件 ,如果想要它弹出窗口后按确定
转到另外一个页面,你可以自己作一个页面,用他来实现 alert 的功能,同时在新建也面中添加一个按钮,通过该按钮的触发事件来完成。
其中原来页面中可以这样写:
if zt=0 then
response.Redirect("sz.asp")
elseif zt=1 then
response.Redirect("zj.asp")
endif
lbx972 2003-10-08
  • 打赏
  • 举报
回复
UP
kkkuuu 2003-10-08
  • 打赏
  • 举报
回复
那如果要它弹出窗口后按确定
转到另外一个页面该怎么写??
echolwl 2003-10-08
  • 打赏
  • 举报
回复
<%
user_name=Request("user_name")
'user_name="ppmm"
set rs3=server.CreateObject ("ADODB.recordset")
sql="select * from user where user_name='"&user_name&"'"
rs3.Open sql,conn1,1,3
zt=rs3("zt")
if zt=0 then
response.Redirect("sz.asp")
elseif zt=1 then
response.write "<script >"&chr(13)
response.write "alert('你要的弹出的对话框的内容')"&chr(13)
response.write "</script>"&chr(13)

end if
%>
lovehwq21 2003-10-08
  • 打赏
  • 举报
回复
<%
user_name=Request("user_name")
'user_name="ppmm"
set rs3=server.CreateObject ("ADODB.recordset")
sql="select * from user where user_name='"&user_name&"'"
rs3.Open sql,conn1,1,3
zt=rs3("zt")
if zt=0 then
response.Redirect("sz.asp")
elseif zt=1 then
Response.write "<script language=javascript>alert('我对了!');</script>"

end if
%>

28,406

社区成员

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

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