| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 416 人关注过本帖
标题:ASP:图片提交表单内容错在那里?提交后不能提示?
只看楼主 加入收藏
xuehao
Rank: 1
等 级:新手上路
帖 子:25
专家分:0
注 册:2011-1-18
结帖率:55.56%
收藏
 问题点数:0 回复次数:0 
ASP:图片提交表单内容错在那里?提交后不能提示?
我是用同一个页面做的,源文件,打红字和搞不懂,不知道错在那里,提交没显示提示框。
谢各位朋友帮我改下好吗??

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="zcxt/conn.asp" -->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<link href="css/css1.css" rel="stylesheet" type="text/css" />

</head>
<body>
<!--#include file="tbjb/Head.asp" -->
<table width="850" border="0" align="center" cellpadding="0" cellspacing="0" id="zb2">
  <tr>
    <td width="30" valign="top"><img src="img/cont_left_img01.gif" width="30" height="728"></td>
    <td valign="top"><table width="787" border="0" cellpadding="0" cellspacing="0" id="zb2-1">
      <tr>
        <td valign="top">&nbsp;</td>
        <td valign="top">&nbsp;</td>
      </tr>
      <tr>
        <td width="207" valign="top"><table width="200" border="0" cellpadding="0" cellspacing="0" id="zb2-2">
          <tr>
            <td><table width="200" border="0" cellpadding="0" cellspacing="0" id="zb2-3">
               
                <tr>
                  <td><img src="img/left_tc_tit.gif" width="200" height="51"></td>
                </tr>
                <tr>
                  <td height="178" align="center" valign="top" background="img/left_bg02.gif"><iframe src="tpxt/tp.asp" name="dckj" width="198" height="210" align="middle" scrolling="no" frameborder="0"></iframe></td>
                </tr>
                <tr>
                  <td><img src="img/left_img02.gif" width="200" height="8"></td>
                </tr>
            </table></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><table width="200" border="0" cellpadding="0" cellspacing="0" id="zb2-4">
                <tr>
                  <td align="center"><img src="img/left_img04.gif" width="175" height="47" border="0" /></td>
                </tr>
                <tr>
                  <td align="center"><img src="img/left_img05.gif" width="175" height="47" border="0" /></td>
                </tr>
                <tr>
                  <td align="center"><img src="img/left_img06.gif" width="175" height="47" border="0" /></td>
                </tr>
                <tr>
                  <td align="center"><img src="img/xsrx_img.gif" width="185" height="51" border="0" /></td>
                </tr>
            </table></td>
          </tr>
        </table></td>
        <td valign="top"><table width="580" border="0" cellpadding="0" cellspacing="0" id="zb2-5">
          <tr>
            <td><img src="img/cont_img01.gif" width="580" height="17"></td>
          </tr>
          <tr>
            <td><table width="580" border="0" cellpadding="0" cellspacing="0" id="zb2-6">
              <tr>
                <td width="9" background="img/cont_tbl01_bg01.gif">&nbsp;</td>
                <td align="center" valign="top"><table width="540" border="0" cellpadding="0" cellspacing="0" id="zb2-7">
                  <tr>
                    <td height="45" align="left" valign="top"><img src="img/hyzx.gif" width="298" height="36"></td>
                  </tr>
                  <tr>
                    <td><table width="540" border="0" cellpadding="0" cellspacing="0" id="zb2-8">
                      <tr>
                        <td colspan="3"><img src="img/gsjs_img01.gif" width="540" height="19"></td>
                        </tr>
                      <tr>
                        <td width="22"  align="left" valign="top" ><img src="img/gsjs_img03.gif" width="22" height="155" /></td>
                        <td width="500" rowspan="2" align="center" valign="top"><form id="form1" name="form1" method="post" action="?">
                          <table width="100%" border="0" cellpadding="0" cellspacing="0" id="zb-9">
                            <tr>
                              <td height="20" colspan="2" align="center" class="zt12-hs">新用户注册</td>
                              </tr>
                            <tr>
                              <td width="40%" height="40" align="left"><span class="zt12-hs">用户名:</span><br />
不能小于4个字符(2个汉字)<br />
                              </span></td>
                              <td width="62%" align="left">
                                <input name="UserName" type="text" id="UserName" maxlength="14" />
                                <span class="zt12-hsh">*                                </span></td>
                            </tr>
                            <tr>
                              <td width="38%" height="40" align="left"><span class="zt12-hs">密码(至少6位):</span><br />
请输入密码,区分大小写。 不要使用类似 '*'、' '的特殊字符</td>
                              <td align="left"><input name="Password" type="text" id="Password" maxlength="14" />
                                <span class="zt12-hsh">*</span></td>
                            </tr>
                            <tr>
                              <td width="38%" height="40" align="left"><span class="zt12-hs">确认密码(至少6位):</span><br />
                                请再输一遍确认</td>
                              <td align="left"><input name="PwdConfirm" type="text" id="PwdConfirm" maxlength="14" />
                                <span class="zt12-hsh">*</span></td>
                            </tr>
                            <tr>
                              <td width="38%" height="40" align="left"><span class="zt12-hs">密码问题:
                                </span><br />
                                忘记密码的提示问题</td>
                              <td align="left"><input type="text" name="textfield" />
                                <span class="zt12-hsh">*</span></td>
                            </tr>
                            <tr>
                              <td width="38%" height="40" align="left"><span class="zt12-hs">问题答案:</span>                                <br />
                                忘记密码的提示问题答案,用于取回密码</td>
                              <td align="left"><input name="Answer" type="text" id="Answer" maxlength="14" />
                                <span class="zt12-hsh">*</span></td>
                            </tr>
                            <tr>
                              <td width="38%" height="40" align="left"><span class="zt12-hs">性别:</span><br />
                                请选择您的性别</td>
                              <td align="left"><input name="sex" type="radio" value="1" checked="checked" />
                                
                                  <input type="radio" name="sex" value="0" />
                                  女</td>
                            </tr>
                            <tr>
                              <td width="38%" height="40" align="left"><span class="zt12-hs">Email地址:</span><br />
                                请输入有效的邮件地址</td>
                              <td align="left"><input name="Email" type="text" id="Email" maxlength="50" />
                                <span class="zt12-hsh">*</span></td>
                            </tr>
                            <tr>
                              <td width="38%" height="40" align="left" class="zt12-hs">公司网址:</td>
                              <td align="left"><input name="homepage" type="text" id="homepage" value="http://" /></td>
                            </tr>
                            <tr>
                              <td width="38%" height="40" align="left"><span class="zt12-hs">公司名称:</span><br />
                                您的公司名称</td>
                              <td align="left"><input name="Comane" type="text" id="Comane" maxlength="50" /></td>
                            </tr>
                            <tr>
                              <td width="38%" height="40" align="left" class="zt12-hs">邮政编码:</td>
                              <td align="left"><input name="Zip" type="text" id="Zip" maxlength="14" />
                                <span class="zt12-hsh">*</span></td>
                            </tr>
                            <tr>
                              <td width="38%" height="40" align="left"><span class="zt12-hs">联系电话:</span><br />
                                格式13117101402</td>
                              <td align="left"><input name="Phone" type="text" id="Phone" maxlength="20" />
                                <span class="zt12-hsh">*</span></td>
                            </tr>
                            <tr>
                              <td width="38%" height="40" align="left" class="zt12-hs">传 真:</td>
                              <td align="left"><input name="Fox" type="text" id="Fox" maxlength="50" /></td>
                            </tr>
                          </table>
                         <input type="image" src= "ttpp/image/button4.gif " value="注册" name="Submit" id="submit" onclick="document.forms[1].submit">???????????????????
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                      <input name="Submit2" type="image" id="Submit2" src="ttpp/image/button3.gif" />
                        </form>                        </td>
                        <td width="20" align="right" valign="top" background="img/gsjs_right_bg01.gif"></td>
                      </tr>
                      <tr>
                        <td valign="top" background="img/gsjs_bg01.gif">&nbsp;</td>
                        <td valign="top"><img src="img/gsjs_img04.gif" width="20" height="228" /></td>
                      </tr>
                      <tr>
                        <td colspan="3"><img src="img/gsjs_img02.gif" width="540" height="18"></td>
                        </tr>
                    </table></td>
                  </tr>
                </table></td>
                <td width="9" background="img/cont_tbl01_bg01.gif"></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td><img src="img/cont_img02.gif" width="580" height="17"></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
    <td width="30" valign="top"><img src="img/cont_right_img01.gif" width="33" height="728" /></td>
  </tr>
  <tr>
    <td><img src="img/cont_di_img01.gif" width="30" height="29"></td>
    <td background="img/cont_di_bg01.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="20" valign="bottom"><img src="img/yqlj_img01.gif" width="57" height="15" /></td>
        <td>&nbsp;</td>
      </tr>
    </table></td>
    <td><img src="img/cont_di_img02.gif" width="33" height="29"></td>
  </tr>
</table>
<!--#include file="tbjb/foot.asp" -->

</body>
</html>
<%
dim UserName,Password,PwdConfirm,Question,Answer,Sex,Email,HomePage,Comane,Add,Somane,Zip,Phone,Fox
UserName=trim(request("UserName"))
Password=trim(request("Password"))
PwdConfirm=trim(request("PwdConfirm"))
Question=trim(request("Question"))
Answer=trim(request("Answer"))
Sex=trim(Request("Sex"))
Email=trim(request("Email"))
HomePage=trim(request("HomePage"))
Comane=trim(request("Comane"))
Add=trim(request("Add"))
Somane=trim(request("Somane"))
Zip=trim(request("Zip"))
Phone=trim(request("Phone"))
Fox=trim(request("Fox"))

if request("submit")="form1" then   ???????????????????????????????

if UserName="" or len(UserName)>14 or len(UserName)<6 then
Response.Write("<script language=""JavaScript"">alert(""请输入您的用户名(长度不能大于14或小于6)。!!"");history.go(-1);</script>")
response.end
end if

if instr(UserName,"&")>0 or instr(UserName,",")>0 or instr(UserName,"^")>0 or instr(UserName,"#")>0 or instr(UserName,"[")>0 or instr(UserName,"?")>0 or instr(UserName,"/")>0 or instr(UserName,"\")>0 or instr(UserName,"-")>0then
Response.Write("<script language=""JavaScript"">alert(""非法字符,用户名必须是中文,字母大小写,下划线"");history.go(-1);</script>")
 response.end
end if

if Password = ""  then
  Response.Write("<script language=""JavaScript"">alert(""密码必须填入!!"");history.go(-1);</script>")
  response.end
end if

if len(Password )>8 or len(Password )<6 then
Response.Write("<script language=""JavaScript"">alert(""密码(长度不能大于8或小于6)。!!"");history.go(-1);</script>")
response.end
end if

if instr(Password,"&")>0 or instr(Password,",")>0 or instr(Password,"^")>0 or instr(Password,"#")>0 or instr(Password,"[")>0 or instr(Password,"?")>0 or instr(Password,"/")>0 or instr(Password,"\")>0 or instr(Password,"-")>0then
Response.Write("<script language=""JavaScript"">alert(""非法字符,必须填入6到8的字符"");history.go(-1);</script>")
 response.end
end if



dim rs,sql
set rs=server.createobject("adodb.recordset")
sql="select * from User where UserName='"&UserName&"'" '这里连接的是变量名:&username&
rs.open sql,conn,1,1

if(not rs.eof) then '这里记录集光标道理见其他解释
Response.Write("<script language=""JavaScript"">alert(""错误:你注册的用户名已经存在!!"");history.go(-1);</script>")

conn.close  
set rs=nothing
set conn=nothing
response.end
end if

sql="select * from User"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
        rs("UserName")=UserName
        rs("Password")=md5(Password)
        rs("Question")=Question
        rs("Answer")=md5(Answer)
        rs("Sex")=Sex
        rs("Email")=Email
        rs("HomePage")=HomePage
        rs("Comane")=Comane
        rs("Add")=Add
        rs("Somane")=Somane
        rs("Zip")=Zip
        rs("Phone")=Phone
        rs("Fox")=Fox
        rs.update
        founderr=false

rs.close
set rs=nothing
Response.Write "<script language=""javascript"">window.alert('添加成功!请登陆');window.location.replace('zcyhdl.asp');</script>"
end if
%>
搜索更多相关主题的帖子: include title 源文件 PUBLIC content 
2011-08-06 15:15
快速回复:ASP:图片提交表单内容错在那里?提交后不能提示?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.032515 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved