我想做一个只有提交界面的留言板,用ASP+ACCESS数据库的,有高手帮忙吗?
default.asp:
-------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>留言板</title>
<style type="text/css">
<!--
.tt {font-family:"宋体";font-size:14px;line-height:22px}
.but{background-color: #D2F2FD; color: #000000; border: 1 solid #6CC1FB}
td,table {font-family:"宋体";font-size:12px;line-height:16px}
-->
</style>
</head>
<body>
<table border="0" width="102%">
<tr>
<td width="100%">
<!--#include file="../share/.asp"-->
</td>
</tr>
<tr>
<td width="100%">
<center>
<table border="0" width="80%" cellspacing="1" cellpadding="1">
<tr>
<td width="100%">
<p align="center"><!--#include file="showMsg.asp"--></p>
</td>
</tr>
<tr>
<td width="100%">
<form name="form1" method="post" action="add_Msg.asp">
<center>
<table border="1" width="70%">
<tr>
<td width="100%">主题:<input type="text" name="ly_Tilte" >
作者:<input type="text" name="ly_author" size="19"></td>
</tr>
<tr>
<td width="100%"><textarea name="ly_Content" rows="4" cols="51"></textarea></td>
</tr>
<tr>
<td width="100%">
<input type="hidden" name="ly_Sign" value="1">
<p align="center"><input type="submit" name="ly_s1" value="确定"></p>
</td>
</tr>
</table>
</center>
</form>
</td>
</tr>
</center>
<center>
</table>
</center>
</td>
</tr>
</table>
</body>
</html>
添加留言add_Msg.asp
---------
<%Response.Buffer=True%>
<%Option Explicit%>
<%
程序名:add_Msg.asp
功 能:添加新留言
编写者:tigerwen01
日 期:2005-04-22
%>
<%
Dim oConn,strSQL
开始连接数据库
Set oConn=Server.CreateObject("ADODB.Connection")
oConn.Open Application("ConnectDataSourceString")
连接数据库结束
%>
<%
获取提交值
Dim Ly_Title,Ly_Content,Ly_Author,Ly_Sign
Ly_Title=Trim(Request.Form("ly_Tilte"))
Ly_Content=Trim(Request.Form("ly_Content"))
Ly_Author=Trim(Request.Form("ly_author"))
Ly_Sign=Trim(Request.Form("ly_Sign"))
if Request("ly_s1")="确定" then
保存内容
strSQL=""
strSQL="insert into Tb_liuyan(Ly_Title,Ly_Content,Ly_Author,ly_Sign,Ly_Time)values("&Ly_Title&","&Ly_Content&","&Ly_Author&","&ly_Sign&",now())"
oConn.execute strSQL
Response.redirect "default.asp"
end if
set oConn=nothing
%>