论坛: 网站建设 标题: ASP的问题,求助 复制本贴地址    
作者: ltb [ltb]    论坛用户   登录
刚学这个, 那位大狭帮一下,我搞了一下午都没搞懂,我错在里,要怎么改才真确,谢谢!
下面的一段程序,保存为11.ASP能提交表单的变量吗?
<form action=" wps/cj.asp" method="post"  >
    <form action=" " method="post"  ><p>姓名
      <input type="text" name="name">
    </p>
    <p> 密码
      <input type="text" name="mima">
    </p>
    <p align="center">
      <input type="submit" name="Submit" value="提交">
      <input type="reset" name="Submit2" value="重置">
    </p>
  </form>

js.asp这个程序是下面的保存的
<%

strings=""

if request.form("name")="" then
      strings=strings&"你必须输入姓名!\n"
end if
if request.form("mima")="" then
    strings=strings&"你必须输入密码 \n"
end if

if strings="" then
    datas="'"& request.form("name")&"','"&request.form("mima")&"'"
    writetodatabase(datas)
end if


%>



jc2.asp是下面的保存的
<%
function writetodatabase(datas)
set objconn=server.createobject(adodb.connection)
objconn.open "driver={microsoft access driver(*.mdb)};dbq="&sever.mappath("pws.mdb")

on error resume next
set rs=objconn.execute(sql)
if rs.eof then
      sql="insert into 表1(姓名,密码)"
      sql=sql&"values("&datas&")"
      on error resume next
      if isobjiconn.execute(sql) then
      location "pws/wc.asp"
    else
      strings="错误。请联系"
    end if
else
    strings="已经有相同的书数据,请改了"
end if
errmsgbox(strings)
end function
%>
<% function errmsgbox(errmsg)%>
<script language="javascript">
<!-
<% if errmsg<>"" then %>
    alert("<%=errmsg %>");
      history.go(-1)
<% end if%>
->
</script>
<% end function %>
<% function location(url)%>
<script language="javascript">
  location="<%=url%>"
</script>
<% end function%>


地主 发表时间: 04-01-18 17:41

回复: ltb [ltb]   论坛用户   登录
自己先顶

B1层 发表时间: 04-01-18 18:13

回复: Aoming [aoming]   版主   登录
<form action=" wps/cj.asp" method="post"  >
    <form action=" " method="post"  >
====================================
其他asp部分我不清楚,不过11.asp部分的 form 标签重复了,你的action的值=??

B2层 发表时间: 04-01-22 15:56

论坛: 网站建设

20CN网络安全小组版权所有
Copyright © 2000-2010 20CN Security Group. All Rights Reserved.
论坛程序编写:NetDemon

粤ICP备05087286号