找回密码
 注册
搜索
热搜: 回贴
  • 前程无忧官网首页 有什么好的平台可以
  • 最新的销售平台 互联网营销的平台有哪
  • 制作网页的基本流程 网页制作和网页设
  • 【帝国CMS】输出带序号的列表(数字排
  • 网站建设公司 三一,中联,极东泵车的
  • 织梦 建站 织梦网站模版后台怎么更改
  • 云服务官网 哪些网站有免费的简历模板
  • 如何建网站要什么条件 建网站要用什么
  • 吉林市移动公司电话 吉林省退休人员网
  • 设计类毕业论文 网站设计与实现毕业论
查看: 62|回复: 4

[求助]新手求教,表单提交~谢谢

[复制链接]
发表于 2010-1-7 02:08:56 | 显示全部楼层 |阅读模式 IP:江苏扬州
提交表单
姓名电话地址
张三123456 北京
李四456789广州
点击按钮能添加新的一行,提交是存入相同的字段里。如:张三,李四存入“姓名”里;123456,456789存入“电话”里,该怎么做呢?
查看的时候呢?

新手求教,希望能详细写,或者给个实例也行~
谢谢各位大大了^^
发表于 2010-1-7 02:08:59 | 显示全部楼层 IP:江苏扬州
我也需要
回复

使用道具 举报

发表于 2010-1-7 02:09:02 | 显示全部楼层 IP:江苏扬州
我刚写的一段代码,
你看一看了.
<!--#include file="pwd.asp"-->
<!--#include file=conn1.asp-->
<%
if request("action")="edit" then
id=request("id")
hb=request("hb")
hl=request("hl")
qsrq=request("qsrq")
tzrq=request("tzrq")
hb1=request("hb1")
hl1=request("hl1")
qsrq1=request("qsrq1")
sql="update hbhl set hl="&hl1&",qsrq="&qsrq1&",tzrq="&qsrq&"where id="&id
conn1.execute sql
sql="select * from hbhl"
set rs=server.createObject("adodb.recordset")
rs.open sql,conn1,1,2
rs.addnew
rs("hb")=hb
rs("hl")=hl
rs("qsrq")=qsrq
rs("tzrq")=30000000
rs.update
rs.close
set rs=nothing
response.write "<script language='javascript'>alert('修改成功!')</script>"
response.redirect "rate.asp"
end if


%>
<%
if request("action")="modify" then

id=request("id")
sql="select * from hbhl where id="&id
set rs=server.createObject("adodb.recordset")
rs.open sql,conn1,1,1
if not (rs.eof and rs.bof) then
%>

<p align=center><span class="style1">修改汇率</span><br>

<form name="form2" method="post" action="rate.asp?action=modsubmit&id=<%=id%>" onsubmit="return(check());">
<table width="218" border="0" cellspacing="0" cellpadding="0" style="border-left:1px solid #BD7124;border-right:1px solid #BD7124;border-top:1px solid #BD7124;border-bottom:1px solid #BD7124; ">
<tr>
<td height="25" style="border-right:1px solid #BD7124;border-bottom:1px solid #BD7124; "> 货  币:</td>
<td style="border-bottom:1px solid #BD7124; "><input name="hb" type="text" value=<%=rs("hb")%> size="10"></td></tr>
<tr>
<td height="25" style="border-right:1px solid #BD7124;border-bottom:1px solid #BD7124; "> 汇  率:</td>
<td style="border-bottom:1px solid #BD7124; "><input name="hl" type="text" size="10" value=<%=rs("hl")%>></td></tr>
<tr><td height="25" style="border-right:1px solid #BD7124;border-bottom:1px solid #BD7124; ">起始日期:</td><td style="border-bottom:1px solid #BD7124; "><input name="qsrq" type="text" size="10" value=<%=rs("qsrq")%>></td></tr>

<tr><td height="25" style="border-right:1px solid #BD7124;border-bottom:1px solid #BD7124; ">停止日期:</td><td style="border-bottom:1px solid #BD7124; "><input name="tzrq" type="text" value=<%=rs("tzrq")%> size="10"></td></tr>
<tr align="center">
<td height="25" colspan="2">
<input type="submit" name="Submit" value="修  改"></td>
</tr>


</table>
</form>

<%
end if
rs.close
set rs=nothing
response.end
end if
%>

<%
if request("action")="modsubmit" then

id=request("id")
hb=request("hb")
hl=request("hl")
qsrq=request("qsrq")
tzrq=request("tzrq")

sql="update hbhl set hb='"&request("hb")&"',hl="&request("hl")&",qsrq="&request("qsrq")&",tzrq="&request("tzrq")&" where id="&id
conn1.execute(sql)
response.redirect "rate.asp"
end if
%>
<%
if request("action")="delsubmit" then

id=request("id")


sql="delete from hbhl where id="&id
conn1.execute(sql)
response.redirect "rate.asp"
end if
%>
<%
set rs=server.CreateObject("ADODB.recordset")
set rs1=server.CreateObject("ADODB.recordset")
sql1="select * from hbhl order by id"
sql="select * from hbhl order by tzrq desc"
rs.open sql,conn1,1,1
rs1.open sql1,conn1,1,1
qsrq_old1=rs("qsrq")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>汇率修改</title>
<script java="javascript">
function check(){
var regex=/^\d(\.)^\d/;
var qsrq=document.form1.qsrq.value;
var qsrq_old='<%=qsrq_old1%>';
var hl=document.form1.hl.value;
var flag=false;

if (hl==""){

alert("汇率不能为空!");
return false;

}
if (regex.test(hl)){

alert("汇率只能为整数或小数!");
 return false;

}

if(parseInt(qsrq)>parseInt(qsrq_old)){

flag=true;
}
else{

alert("您输入的起始日期不对!");
flag=false;
}
return flag;

}
</script>
<style type="text/css">
<!--
.style1 {
font-size: 18px;
font-weight: bold;
}
-->
</style>
</head>
<body>
<%
if not(rs1.eof and rs1.bof) then %>
<p align=center>原有汇率信息</p>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0" style="border-left:1px solid #BD7124;border-right:1px solid #BD7124;border-top:1px solid #BD7124;border-bottom:1px solid #BD7124; ">
<tr align="center">
<td width="66" style="border-right:1px solid #BD7124;border-bottom:1px solid #BD7124; ">货  币</td>
<td width="78" style="border-right:1px solid #BD7124;border-bottom:1px solid #BD7124; ">利  率</td>
<td width="78" style="border-right:1px solid #BD7124;border-bottom:1px solid #BD7124; ">起始日期</td>
<td width="78" style="border-right:1px solid #BD7124;border-bottom:1px solid #BD7124; ">停止日期</td>
<td width="78" style="border-right:1px solid #BD7124;border-bottom:1px solid #BD7124; ">修  改</td>
<td width="80" style="border-right:1px solid #BD7124;border-bottom:1px solid #BD7124; ">删  除</td>
</tr>
<%do while not rs1.eof%>
<tr align="center">
<td style="border-right:1px solid #BD7124;border-bottom:1px solid #BD7124; "><%=rs1("hb")%></td>
<td style="border-right:1px solid #BD7124;border-bottom:1px solid #BD7124; "><%=rs1("hl")%></td>
<td style="border-right:1px solid #BD7124;border-bottom:1px solid #BD7124; "><%=rs1("qsrq")%></td>
<td style="border-right:1px solid #BD7124;border-bottom:1px solid #BD7124; "><%=rs1("tzrq")%></td>
<td style="border-right:1px solid #BD7124;border-bottom:1px solid #BD7124; "><a href="rate.asp?action=modify&id=<%=rs1("id")%>">修改</a></td>
<td style="border-right:1px solid #BD7124;border-bottom:1px solid #BD7124; "><a href="rate.asp?action=delsubmit&id=<%=rs1("id")%>" onclick="return(confirm('确定要删除吗?'))">删除</a></td>
</tr>
<%
rs1.movenext
loop
%>
</table>
<%
end if
%>

<%

if not (rs.eof and rs.bof) then
%>
<center>

<p><span class="style1">添加新一期汇率</span><br>

<form name="form1" method="post" action="rate.asp?action=edit" onsubmit="return(check());">
<table width="218" border="0" cellspacing="0" cellpadding="0" style="border-left:1px solid #BD7124;border-right:1px solid #BD7124;border-top:1px solid #BD7124;border-bottom:1px solid #BD7124; ">
<tr>
<td height="25" style="border-right:1px solid #BD7124;border-bottom:1px solid #BD7124; "> 货  币:</td>
<td style="border-bottom:1px solid #BD7124; "><input name="hb" type="text" value=<%=rs("hb")%> size="10" readonly></td></tr>
<tr>
<td height="25" style="border-right:1px solid #BD7124;border-bottom:1px solid #BD7124; "> 汇  率:</td>
<td style="border-bottom:1px solid #BD7124; "><input name="hl" type="text" size="10"></td></tr>
<tr><td height="25" style="border-right:1px solid #BD7124;border-bottom:1px solid #BD7124; ">起始日期:</td><td style="border-bottom:1px solid #BD7124; "><input name="qsrq" type="text" size="10"></td></tr>

<tr><td height="25" style="border-right:1px solid #BD7124;border-bottom:1px solid #BD7124; ">停止日期:</td><td style="border-bottom:1px solid #BD7124; "><input name="tzrq" type="text" value=30000000 size="10" readonly></td></tr>
<tr align="center">
<td height="25" colspan="2"><input type="hidden" name="hb1" value=<%=rs("hb")%>>
<input type="hidden" name="hl1" value=<%=rs("hl")%>>
<input type="hidden" name="id" value=<%=rs("id")%>>
<input type="hidden" name="qsrq1" value=<%=rs("qsrq")%>>
<input type="submit" name="Submit" value="添 加"></td>
</tr>


</table>
</form>
</center>
<% end if%>
</body>
</html>
只能看不能运行了.
回复

使用道具 举报

发表于 2010-1-7 02:09:05 | 显示全部楼层 IP:江苏扬州
不太明白...也不能运行...
帮忙解释一下吧~或者给个能运行简单点的实例~
谢谢了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-30 11:34 , Processed in 0.303212 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表