index.asp部分代码如下
<form action="dinggou_save.asp" method="get" name="search">
<table width="285" height="287" border="0">
<tr>
<td height="31" colspan="2"><div align="center"><span class="STYLE1">分析</span></div></td>
</tr>
<tr>
<td width="86"><div align="center">姓名:</div></td>
<td width="189"><input type="text" name="user" maxlength="11" id="user" /></td>
</tr>
<tr>
<td><div align="center">电话:</div></td>
<td><input type="text" name="tel" maxlength="11" id="user2" /></td>
</tr>
<tr>
<td><div align="center">邮箱:</div></td>
<td><input type="text" name="mail" maxlength="11" id="user3" /></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input name="submit" type="submit" value="确定"/>
</div></td>
</tr>
</table>
</form>
...........
<form action="dinggou_text.asp" method="get" name="search">
<table width="285" height="287" border="0">
<tr>
<td height="31" colspan="2"><div align="center"><span class="STYLE1">提示</span></div></td>
</tr>
<tr>
<td width="80"><div align="center">姓名:</div></td>
<td width="195"><input type="text" name="user_text" maxlength="11" id="user5" /></td>
</tr>
<tr>
<td><div align="center">电话:</div></td>
<td><input type="text" name="tel_text" maxlength="11" id="user23" /></td>
</tr>
<tr>
<td><div align="center">邮箱:</div></td>
<td><input type="text" name="mail_text" maxlength="11" id="user33" /></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input name="submit3" type="submit" value="确定"/>
</div></td>
</tr>
</table>
</form>
dinggou_save.asp代码如下:
<%
dim conn
dim connstr
connstr="DBQ="+server.mappath("database/cgrj.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
Set Rs=Server.CreateObject("ADODB.RecordSet")
SqlStr="select * from cgrj"
Rs.Open SqlStr,conn,1,3
Rs.addnew
Rs("user")=request.Form("user")
Rs("tel")=request.Form("tel")
Rs("mail")=request.Form("mail")
Rs("time")=now()
Rs.update
Rs.Close
set conn=nothing
response.Write("<script>alert('您好,您所填写的信息已成功提交,正在转入首页');location.href='index.asp';</script>")
%>
dinggou_text.asp代码如下。
<%
dim conn
dim connstr
connstr="DBQ="+server.mappath("database/cgrj.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
Set Rs=Server.CreateObject("ADODB.RecordSet")
SqlStr="select * from dpfx"
Rs.Open SqlStr,conn,1,3
Rs.addnew
Rs("user_text")=request.Form("user_text")
Rs("tel_text")=request.Form("tel_text")
Rs("mail_text")=request.Form("mail_text")
Rs("time")=now()
Rs.update
Rs.Close
set conn=nothing
response.Write("<script>alert('您好,您所填写的信息已成功提交,正在转入首页');location.href='index.asp';</script>")
%>
第一个好使确认按钮好使可以插入数据库,但是第二个就不行了呢?