showerror(msg) , ShowSuccess("数据已经成功保存!")!!老是提示错误!!

hsrcm7612 2002-07-29 05:42:03
为什么showerror(msg) , ShowSuccess("数据已经成功保存!")!!老是提示错误!!
...全文
491 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
meizz 2002-07-30
  • 打赏
  • 举报
回复
showerror(msg) , ShowSuccess("数据已经成功保存!")
请问这两个自定义函数你是在哪里定义的呀?
如果是在<!--#include file=copyright.asp-->里定义的话,你将这句放到文件的最顶。
evonne_feng 2002-07-30
  • 打赏
  • 举报
回复
你的showErr函数呢
hsrcm7612 2002-07-30
  • 打赏
  • 举报
回复
<%@ LANGUAGE="VBScript"%>
<% response.buffer=true %>
<%const title="新增用户"%>
<html>
<head>
<meta http-equiv="Content-Type"content="text/html; charset=gb_2312-80">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">

<link rel=stylesheet type=text/css href=forum.css>
</head>
<body bgcolor="#6699ff" topmargin="0">
<!--#include file=myPrg.asp-->
<!--#include file=opendb.inc-->

<%
if Request.ServerVariables("REQUEST_METHOD")="POST" then
msg=""
if request("username")="" then
msg=msg+"请输入用户名!<br>"
end if
if request("passwd")="" then
msg=msg+"请输入密码!<br>"
end if
if request("confirm")="" then
msg=msg+"请输入确认密码!<br>"
end if
if request("passwd")<>request("confirm") then
msg=msg+"密码和确认密码不一致!<br>"
end if
if msg<>"" then
showerror(msg)
end if

sql="select * from user where username='"&Request.form("username")&"'"
rs.open sql,adocon,3,2
if not rs.eof then
showerror("该用户名已经存在,请重新选用另一个试试!")
else
rs.addnew
rs("username")=request.form("username")
rs("passwd")=request.form("passwd")
rs("purview")=request.form("purview")
rs.update
ShowSuccess("数据已经成功保存!")
end if
rs.close
else
%>

<form action="newuser1.asp" method="POST" name="input">
<p align=center><font color=red>请在以下的表格中填入相关的数据</font>
<p>
<table align=center border=0 height="182">
<tr>
<td nowrap height="35"><font color="#000000" size="2">                
用    户:</font><input class=smallInput type=textbox name="username" value=''>**</td>
</tr>
<tr>
<td nowrap height="35"><font color="#000000" size="2">                
密    码:</font><input class=smallInput type=password name="passwd" value=''>**</td>
</tr>
<tr>
<td nowrap height="35"><font color="#000000" size="2">                
确认密码:</font><font size="2"><input class=smallInput type=password name="confirm" value=''></font><font size="2">**</font></td>
</tr>

<tr>
<td width=510 height="36" align="center">
<p align="left"><font size="2">                
用户权限:  <select size="1" name="purview">
<option value="0">--请选择--</option>
<option value="1">1</option>
<option value="2">2</option></select></font></p>
</td>
</tr>

<tr>
<td height="45">
          
<p>                    
<input class=buttonface type=submit name=ok value=保存>  <input class=buttonface type=reset name=reset value=复原> 
<input class=buttonface type=button name=retu value=返回 onclick=history.go(-1)>
<br>   
</tr>
</table>
</form>
<%end if%>
<!--#include file=copyright.asp-->
</body>
</html>
xiruo 2002-07-29
  • 打赏
  • 举报
回复
君子藏器 2002-07-29
  • 打赏
  • 举报
回复
你应该把代码贴出来,就这一句别人怎么知道错误在那儿。

28,391

社区成员

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

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