當前位置:首頁 » 操作系統 » 留言板asp源碼

留言板asp源碼

發布時間: 2023-09-12 17:47:26

⑴ 編寫一個asp留言板源代碼

<link href="../../css/user.css" rel="stylesheet" type="text/css">
<script language="javaScript" src="../../js/common.js"></script>
<script language="JavaScript" src="../../js/ubbcode.js"></script>

<script language="JavaScript">
function formCheck()
{

if (document.theform.nickname.value == "")
{
alert("請填寫名字。");
document.theform.nickname.focus();
return false;
}

if (document.theform.content.value == "")
{
alert("請填寫留言內容。");
document.theform.content.focus();
return false;
}
theform.Submit.disabled=true;
return true;
}

function showimage()
{
document.images.faceimg.src=face_image[parseInt(document.theform.face.options[document.theform.face.selectedIndex].value)];
}
<body background="http://cache26.51.com/photo1/14/cf/amulostlove/1151766298434_1.jpg">
<center>
<IFRAME marginHeight=0 marginWidth=0 noResize scrolling=no frameBorder=0 src="http://ads.activepower.net/script/ad/ad_show.asp?group_id=8&bgcolor=ffffff" width=468 height=60>
</IFRAME>
</center>
<p> </p>
<form name="theform" onsubmit="return formCheck();" method="post" action="get_post.asp">
<TABLE width=550 border=0 align="center" cellPadding=0 cellSpacing=0>
<table width="550" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#ebebeb">
<tr>
<td class="pt9">
<p>*名字:
<input name="nickname" type="text" size="15" maxlength="12" class="inputbox1">
<br>
Email:
<input name="email" type="text" size="15" maxlength="45" class="inputbox1">
主頁地址:
<input name="hp_url" type="text" value="http://" size="22" maxlength="125" class="inputbox1">
</p>
</td>
<tr>
<td width="409" class="pt9"> <!--因為圖片連接的原因,本文件只適合include在script/dirname下的文件 -->
<img onClick=bold() src="../../images/icon_editor_bold.gif" width="23" height="22" alt="粗體" border="0"><img onClick=italicize() src="../../images/icon_editor_italicize.gif" width="23" height="22" alt="斜體" border="0"><img onClick=underline() src="../../images/icon_editor_underline.gif" width="23" height="22" alt="下劃線" border="0">

<img onClick=center() src="../../images/icon_editor_center.gif" width="23" height="22" alt="居中" border="0"><img onClick=hyperlink() src="../../images/icon_editor_url.gif" width="23" height="22" alt="超級連接" border="0"><img onClick=email() src="../../images/icon_editor_email.gif" width="23" height="22" alt="Email連接" border="0"><img onClick=image() src="../../images/icon_editor_image.gif" width="23" height="22" alt="圖片" border="0"><img onClick=flash() src="../../images/icon_swf.gif" width="23" height="22" alt="Flash圖片" border="0"><img onClick=showcode() src="../../images/icon_editor_code.gif" width="23" height="22" alt="編號" border="0"><img onClick=quote() src="../../images/icon_editor_quote.gif" width="23" height="22" alt="引用" border="0"><img onClick=list() src="../../images/icon_editor_list.gif" width="23" height="22" alt="目錄" border="0">

<br>
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="pt9">
<tr>
<td width="40" valign="top">*留言:</td>
<td><textarea name="content" cols="50" rows="6" id="content"></textarea></td>
</tr>
</table>
<p align="center">
<input name="replyer" type="hidden" value="">
<input name="reply_content_id" type="hidden" value="">
<input name="userid" type="hidden" value="79444">
<input type="submit" name="Submit" value="確認留言" class="button1">
<input type="reset" name="Reset" value="取消重寫" class="button1">
</p></td>
</tr>
</table>
<p> </p>
</form>
<table width="550" border="0" align="center" cellpadding="2" cellspacing="1">
<tr>
<td width="88" valign="top">
<img src="http://img.mms.sohu.com/mms/1230/86/32486/p2.gif">

</td>
<td width="417"><TABLE width="100%" border=0 cellPadding=0 cellSpacing=0 class="pt9">
<TBODY>
<TR>
<TD width=43 colSpan=2 height=29 rowSpan=2><IMG height=29
src="../../images/1_r2_c2.gif" width=43 border=0></TD>
<TD background=../../images/1_r2_c4.gif height=10></TD>
<TD width=37 colSpan=2 height=29 rowSpan=2><IMG height=29
src="../../images/1_r2_c6.gif" width=37 border=0></TD>
</TR>
<TR>
<TD height=19> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD class="pt9"> <font class="filtertxt">dsfsd</font> </TD>
<TD width="168" align=right class="pt9"> </TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
<TR>
<TD width=10 background=../../images/1_r4_c2.gif></TD>
<TD width=27></TD>
<TD width="100%" height=50> <img src="../../images/blank.gif" width="5" height="5">
<br> fdsfsd<b>dfssdfsdf</b> <br> <img src="../../images/blank.gif" width="5" height="5"> </TD>
<TD width=22></TD>
<TD width=15 background=../../images/1_r4_c2.gif></TD>
</TR>
<TR>
<TD background=../../images/1_r4_c2.gif></TD>
<TD></TD>
<TD height=1><hr width="100%" size="1" noshade></TD>
<TD></TD>
<TD background=../../images/1_r4_c2.gif></TD>
</TR>
<TR>
<TD width=43 colSpan=2 height=26 rowSpan=2> <IMG height=26 src="../../images/1_r6_c2.gif" width=43 border=0></TD>
<TD align=right height=17>
<img src="../../images/no_home.gif" align="absmiddle"> <img src="../../images/no_email.gif" align="absmiddle"> <FONT color=#336600>[2006-7-17 21:24:00]</FONT> </TD>
<TD width=43 colSpan=2 height=26 rowSpan=2><IMG height=26
src="../../images/1_r6_c6.gif" width=37 border=0></TD>
</TR>
<TR>
<TD background=../../images/1_r2_c4.gif
height=9></TD>
</TR>
</TBODY>
</TABLE></td>
</tr>
</table>
<BR>
<form>
<table width="516" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<table width=100% border=0 cellspacing=1 cellpadding=2 class=pt9><tr><td height=13><img src=../../images/turnpage2_1.gif align=absmiddle border=0> <img src=../../images/turnpage2_2.gif align=absmiddle border=0> <b>1</b> | <img src=../../images/turnpage2_3.gif align=absmiddle border=0> <img src=../../images/turnpage2_4.gif align=absmiddle border=0></td><td class=pt9 width=140 align=right>共<font color=red>1</font>頁第<input type=text name=JumpPage maxlength=3 size=3>頁<input type=button value=轉頁 onClick="location.href='/script/user/list.asp?userid=79444&page=' + this.form.JumpPage.value;"></td></tr></table>
</td>
</tr>
</table>
</form>

⑵ 請問有誰知道版主回復留言時的ASP源代碼

很簡單啊
我是這樣做的:
資料庫(userLiuyan.mdb)里新建一個留言表:liuyan
表中欄位:ID,(留言編號,自動編號)
userID(用戶編號或用戶名,文本型),
times(留言時間,日期時間型),
liuyan(留言內容,文本或備注型),
huifu(斑竹回復,文本或備注型)
用戶留言的時候只添加前四個欄位的值,斑竹管理留言的時候給某條留言回復就添加到相應的回復欄位里再顯示給你就可以了.比如:
用戶顯示頁面:show.asp
<%
set conn=server.createObject("ADODB.Connection")
conn.connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("userLiuyan.mdb")
conn.Open
sql="select * from liuyan"
set rs=server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1
Do While Not rs.Eof
Response.Write rs("userID") &"<br/>"
Response.Write rs("times") &"<br/>"
Response.Write rs("liuyan") &"<br/>"
If rs("huifu")<>"" Then
Response.Write rs("huifu") &"<br/>"
Else
Response.Write "等待回復..."
End If
rs.MoveNext
Loop
%>
斑竹管理留言回復頁:huifu.asp
<% '顯示用戶留言
set conn=server.createObject("ADODB.Connection")
conn.connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("userLiuyan.mdb")
conn.Open
sql="select * from liuyan"
set rs=server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1
Do While Not rs.Eof
Response.Write rs("userID") &"<br/>"
Response.Write rs("times") &"<br/>"
Response.Write rs("liuyan") &"<br/>"
If rs("huifu")<>"" Then
Response.Write rs("huifu") &"<br/>"
Else
Response.Write "<a href=""?method=huifu&ID="&rs("ID")&""">回復</a>"
End If
rs.MoveNext
Loop

'向資料庫里添加回復
If Request.QueryString("Method")="huifu" Then
sql="update liuyan set huifu='謝謝你的留言' where="& Request.QueryString("ID")
conn.Execute(sql)
Response.Write"回復成功!"
End If
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
答案還可以嗎?

⑶ 求網頁製作:製作留言板的代碼

<!--#include file="../inc/conn.asp"-->
<%
dim name,qq,email,sex,liuyan,ly_type,ip,riqi
name=request("ly_user_name")
qq=request("ly_user_qq")
email=request("ly_user_email")
sex=request("ly_sex")
liuyan=request("ly_liuyan")
ly_type=request("ly_type")
ip=request.ServerVariables("REMOTE_ADDR")

if name="" then
response.write "<script language=javascript>alert('您的名字沒有填寫,請填寫完整信息,謝謝!');history.go(-1);</script>"
elseif qq="" then
response.write "<script language=javascript>alert('忘了QQ哦');history.go(-1);</script>"
elseif liuyan="" then
response.write "<script language=javascript>alert('留言內容不能為空!');history.go(-1);</script>"

else
if ly_type="" then
ly_type=1
else
ly_type=2
end if

dim sql

sql="insert into liuyan(ly_user_name,ly_user_qq,ly_user_email,ly_sex,ly_liuyan,ly_type,ly_user_ip,ly_user_riqi) values('" & name & "','" & qq & "','" & email & "','" & sex & "','" & liuyan & "','" & ly_type & "','" & ip & "',#" & date() & "#)"
db.execute(sql)

response.redirect "ly_main.asp"
end if
%>

熱點內容
領航s1配置怎麼樣 發布:2025-01-26 09:58:10 瀏覽:763
公司區域網搭建伺服器搭建 發布:2025-01-26 09:16:56 瀏覽:433
android裁剪圓形圖片 發布:2025-01-26 09:05:56 瀏覽:411
小貸源碼 發布:2025-01-26 08:20:58 瀏覽:536
更換電腦名登錄伺服器 發布:2025-01-26 07:56:52 瀏覽:240
後台phpjava 發布:2025-01-26 07:12:34 瀏覽:657
微信解綁密碼是什麼 發布:2025-01-26 06:50:07 瀏覽:734
app如何訪問伺服器 發布:2025-01-26 06:36:56 瀏覽:741
拳皇安卓單機哪裡下載 發布:2025-01-26 06:30:46 瀏覽:539
注冊會員時積分消費密碼是什麼 發布:2025-01-26 06:30:45 瀏覽:247