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

留言板源碼

發布時間: 2022-01-25 17:40:21

Ⅰ 網頁留言板代碼

<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>

Ⅱ 網頁留言板的代碼

<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
<%@ Language=VBScript %>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="guest_lib.asp" --><%
dim ASPBook
dim Strsql

if not isempty(request("page")) then
Mypage=cint(Request("page"))
else
Mypage=1
end if

set ASPBook = Server.CreateObject("ADODB.Recordset")

StrSQL = "Select * from guest order by ID desc"
ASPBook.open StrSQL,conn,1,1

ASPBook.pagesize=Mypagesize
maxpages=cint(ASPBook.pagecount)
totalsize=cint(Mypagesize)
ASPBook.absolutepage=Mypage
GuestTotal=ASPBook.RecordCount

if cint(Mypage) >1 then
if cint(Mypage) > maxpages then
MESSAGE("<li>沒有你所想去的頁數!</li>")
Response.End
end if
end if
HEADER "顯示留言"
MyMenu
%>
<html>

<head>
<title>[ 客戶留言系統 ]</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="css/colorbird.css">
<style>
BODY {SCROLLBAR-FACE-COLOR: #D4D0C8; SCROLLBAR-HIGHLIGHT-COLOR: #999999; SCROLLBAR-SHADOW-COLOR: #999999; SCROLLBAR-3DLIGHT-COLOR: #FFFFFF; SCROLLBAR-ARROW-COLOR: #000000; SCROLLBAR-TRACK-COLOR: #E3E3E3; SCROLLBAR-DARKSHADOW-COLOR: #666666; }
</style>

</head>

<body bgcolor="#FFFFFF" topmargin="0" leftmargin="0">

<p align="center"><a href="gb_sign.asp">
<img border="0" src="IMAGES/sign.gif" alt="簽寫留言"></a></p>
<td><p align="center"><font color="#000000"><b><font face="Arial" size="1">Total of
<font color="#ff0000"><%=GuestTotal%></font> messages, </font></b></font>
<font face="Arial"><font size="1" color="#ff0000"><%=MyPageSize%></font><font size="1">
messages per page, You are on page</font></font></font><font color="#FF0000"><font size="1" face="Arial"><%=cint(Mypage)%></font>
<%=Greeting%>... <font color="#000000"><%PageLink%></font></p>
</font>
<div align="right"></div></td>
<div align="center">
<center>
<table width="590" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="50"><a href="gb_sign.asp"><img src="IMAGES/shop.gif" alt="簽寫留言" width="89" height="25" border="0"></a></td>
</tr>
</table>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#6699CC" width="590" height="197">
<tr>
<td align="center" height="197">
<table width="590" border="0" cellspacing="0" cellpadding="4" style="border-collapse: collapse" height="35" bgcolor="#F7F7F7">
<tr>
</tr>
<tr>
</tr>
</table>
<table cellspacing="1" border="1" width="592" height="23" style="border-collapse: collapse" cellpadding="0" bgcolor="#C6C3C6" bordercolorlight="#FFFFFF" bordercolordark="#000000" background="table.gif">
<tr>
<td align="right" width="130" height="23">
<p align="left"><b>
<font color="#FFFFFF">留言者 :</font></b></p>
</td>
<td align="right" width="445" height="23">
<p align="left"><b>
<font color="#FFFFFF">留言內容 :</font></b></p>
</td>
</tr>
</table>
<table width="590" border="0" cellspacing="0" cellpadding="0">
<%
If ASPBook.Eof or ASPBook.Bof then
Response.Write "<TR>"
Response.Write "<TD bgcolor=" & Color1 & " align=center colspan=6><FONT STYLE=font-size:9pt>對不起,目前還沒有任何留言,如要留言,請按「我要留言」圖片!</FONT></TD>"
else

i = 0
total = 0

do until ASPBook.Eof or total = totalsize

if i = 0 then

CColor = Color1

else
CColor = Color2

end if

%>
<tr bgcolor="<%=CColor%>">
<td>
<table width="590" border="1" cellspacing="8" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111">
<tr>
</tr>
</table>
<table width="590" border="0" cellpadding="2" style="border-collapse: collapse" bordercolor="#111111" height="1">
<tr>
<td width="137" rowspan="3" height="1" valign="top">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="99%" id="AutoNumber2" height="96">
<tr>
<td width="100%" align="center" height="12"><b><%=ASPBook("名字")%></b></td>
</tr>
<tr>
<td width="100%" align="center" height="54"><%if ASPBook("性別") = "boy" then%>
<br>
<img src="images/boy.gif" alt="英俊瀟灑的 <%=ASPBook("名字")%> 先生" align="middle" border="0">
<%elseif ASPBook("性別") = "girl" then%>
<img src="images/girl.gif" alt="美麗又溫柔的 <%=ASPBook("名字")%> 小姐" align="middle" border="0">
<br>
<%end if%></td>
</tr>
<tr>
<td width="100%" align="center" height="28">Form: <%=ASPBook("來自")%> </td>
</tr>
</table>
</td>
<td width="234" height="1"><font size="1">
<font color="#000000" class="littel">
<img src="./icons/em<%=ASPBook("表情")%>.gif" border="0" align="ABSCENTER"></font><font color="#0000FF" class="littel">On:
<%=ASPBook("留言日期")%></font></font><font size="1" color="#0000FF">
</font></td>
<td width="212" height="1"><%if ASPBook("郵件")<>"" then%>
<a href="mailto:<%=ASPBook("郵件")%>">
<img src="images/email.gif" ALIGN="absmiddle" border="0" width="15" height="16"></a>
<%end if%> <%if ASPBook("主頁")<>"" and ASPBook("主頁")<>"http://" then%>
<a href="<%=ASPBook("主頁")%>" Target="_blank">
<img src="images/home.gif" ALIGN="absmiddle" border="0"></a>
<%end if%> <%if ASPBook("ICQ")<>"" then%>
<img src="images/icq.gif" alt="ICQ:<%=ASPBook("ICQ")%>" align="absmiddle" border="0" width="15" height="16">
<%if ASPBook("OICQ")<>"" then%> <%end if%>
<a href="http://club3.tencent.com:81/cgi-bin/friend/show_info?ln=<%=ASPBook("OICQ")%>" target="_blank">
<img src="images/oicq.gif" alt="OICQ:<%=ASPBook("OICQ")%>" align="absmiddle" border="0" width="16" height="16"></a>
<%end if%>
<img src="images/ip.gif" alt="<%=ASPBook("IP")%>" align="absmiddle" border="0" width="13" height="16">
<img src="images/system.gif" alt="<%=ASPBook("系統")%>" align="absmiddle" border="0" width="15" height="16"></td>
</tr>
<tr>
<td width="450" height="14" colspan="2" valign="top"><%=ASPBook("留言")%> </td>
</tr>
<tr>
<%if ASPBook("Reply")<>"" then%><td width="450" height="17" colspan="2" valign="top">
<font color="#FF0000">Reply :<b> </b></font>
<font color="#0000FF" class="littel" size="1">(<%=ASPBook("Reply_Date")%>)</font><br>
<img src="./icons/em<%=ASPBook("Reply_Icon")%>.gif" border="0" align="ABSCENTER"><%=ASPBook("Reply")%></font></td>
<%end if%></tr>
</table>
<table width="590" border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td width="137" rowspan="2"> </td>
<td width="450"></td>
</tr>
<tr>
<td width="450"> </td>
</tr>
</table>
<table width="590" height="24" border="0" cellpadding="0" cellspacing="1" bordercolor="#DCE8F3" bordercolorlight="#FFFFFF" bgcolor="#DCE8F3" style="border-collapse: collapse">
<tr>
<td align="right" width="131" height="20">
<p align="left"> </p>
</td>
<td align="right" width="448" height="20">
<a href="gb_reply.asp?page=<%=mypage%>&Number=<%=ASPBook("ID")%>">
<img src="images/quote.gif" alt="回復該留言" align="absmiddle" border="0" width="16" height="16"></a>
<a href="gb_delete.asp?page=<%=mypage%>&Number=<%=ASPBook("ID")%>">
<img src="images/recycle.gif" alt="刪除該留言" align="absmiddle" border="0" width="16" height="16"></a></td>
</tr>
</table>
</td>
</tr>
<%
ASPBook.MoveNext
i = i + 1
if i = 2 then i = 0
total = total + 1
loop
%> <%END IF%>
</table>
<%COPYRIGHT%>
<table border="0" cellpadding="2" cellspacing="0" width="590" height="1" bgcolor="#F7F7F7" style="border-collapse: collapse" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF">
<tr>
<td width="131" height="1">
<p align="center"></p>
</td>
<td align="right" width="448" height="1"><font color="#000000"><%PageLink%>
</font> </td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</div>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="592" id="AutoNumber1">
<tr>
<td width="100%">
<p align="center"><a href="gb_sign.asp"> </a><br>
</p>
</td>
</tr>
</table>
</center>
</div>

</body>

</html>
<%

function PageLink

PageShowSize = 10
Scriptname=Request.Servervariables("script_name")
PageNextSize=int((MyPage-1)/PageShowSize)+1
Pagetpage=int((GuestTotal-1)/MyPageSize)+1

if Maxpages > 1 then
if PageNextSize >1 then
PagePrev=PageShowSize*(PageNextSize-1)
Response.write "<a href='" & Scriptname & "?page=" & PagePrev & "'>[<<]</a>-"
end if
if Mypage-1 > 0 then
Prev_Page = MyPage - 1
Response.write "<a href='" & Scriptname & "?page=" & Prev_Page & "'>[<]</a> "
end if
if maxpages>=PageNextSize*PageShowSize then
PageSizeShow = PageShowSize
else
PageSizeShow = Maxpages-PageShowSize*(PageNextSize-1)
end if
for PageCounterSize=1 to PageSizeShow
PageLink = (PageCounterSize+PageNextSize*10)-10
if PageLink <> cint(Mypage) then
Response.write "<a href='" & Scriptname & "?page=" & PageLink & "'>[" & PageLink & "]</a> "
else
Response.Write PageLink & " "
end if
next
if Mypage+1 <=Pagetpage then
Next_Page = MyPage + 1
Response.write "<a href='" & Scriptname & "?page=" & Next_Page & "'>[>]</a>"
end if
if maxpages > PageShowSize*PageNextSize then
PageNext = PageShowSize * PageNextSize + 1
Response.write "-<a href='" & Scriptname & "?page=" & PageNext & "'>[>>]</a>"
end if
else
Response.write "[1]"
end if
END function

set ASPBook=nothing
conn.Close
set conn = nothing
%>

Ⅲ 求php語言編寫的留言板源碼!!!!!!!!!

這是一個簡單的留言本,目前還沒有後台管理程序。如果哪位高手能補上,那就太好了。

演示在http://www.ideawu.net/person/liuyan

留言保存在message.txt文件中,留言的格式為:date<$>ip<$>name<$>content
"<$>"為分隔符號

注意:源碼文件和message.txt文件必須以gbk格式保存。如果你不知道如何保存文件為gbk格式,請咨詢你的文本編輯器軟體提供商。

/****************************************
* 本代碼可以用作任何用途,但是與作者無關。
* 也就是,你使用本代碼獲取收益或者因此受
* 到損害,後果與作者無關。
****************************************/

file: index.php
代碼:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk">
<title>留言板</title>
<link rel="stylesheet" href="../msg.css" type="text/css">
</head>
<body>
<br><B><FONT COLOR="#0000FF">圖片留言板</FONT></B>
<center>
<table width="800" border="1" bordercolor="#88CCEE" cellspacing="0" cellpadding="4" style="border-collapse:collapse; word-break:break-all">
<tr><td style="border-right-style: none">
<form method="post" action="savemsg.php" style="font-size: 13px">
姓名:<br><input type="text" name="guest_name" maxlength=32 size=32><br>
留言:(字數:<font color="#0000FF"><span id=sNum>0</span></font>/256)<br>
<textarea class="textForm" name="guest_msg" cols="64" rows="8" onkeyup="sNum.innerHTML=this.value.length"></textarea><br>
<input class="button" type="submit" name="submit" value="發表留言">
<input class="button" type="reset" value="重置" name="reset">
</form>
</td></tr>
</table>
<?php
include("showmsg.php");
if(!empty($_GET['p'])){
$num=$_GET['p'];
showpage($num);
}else showpage(1);
?>
</center>
</body>
</html>

file: showmsg.php
代碼:

<?php
function showpage($p)
{ ?>
<table width="800" border="0" bordercolor="#88CCEE" cellspacing="0" cellpadding="4" style="border-collapse:collapse; word-break:break-all;font-size:12px;">
<tr><td>
<p style="line-height: 100%; margin-top: 1; margin-bottom: 1" align="left">
<?php
$perPage=7; //每頁顯示留言數目
$num=$p;
if($num<1) $num=1;
$prev=$num-1;
$next=$num+1;
$page=$num-1; //當前頁碼
$fname="message.txt"; //存儲留言的文件
$all_msg=file($fname); //將留言讀入數組
$line_count=count($all_msg);
$page_count=ceil($line_count/$perPage);
if($prev>0)
echo "<a href=index.php?p=$prev>上一頁</a>";
else
echo "上一頁";
if($line_count>($next-1)*$perPage)
echo "<a href=index.php?p=$next>下一頁</a>";
else
echo "下一頁";
echo "當前第 ".$num." 頁,共有".$page_count."頁,".$line_count."條留言。";
?>
</p></td></tr>
</table>
<table width="800" border="1" bordercolor="#88CCEE" cellpadding="3" cellspacing="0" style="border-collapse:collapse; font-size:12px; word-break:normal; table-layout:fixed;">
<tr height="18" bgcolor="#5FBEF8"><td width="20%">
<b>留言時間/留言者</b></td><td width="86%"><b>留言內容</b>
</td></tr>
<?php
//顯示留言
$bg1="#FBF9F9"; $bg2="#E9EFF4";$bg=$bg2;
for($n=$line_count-1-$page*$perPage;$line_count-1-$page*$perPage-$n<$perPage;$n--){
$bg=($bg==$bg1)? $bg2:$bg1; //變換背景顏色
if(!empty($all_msg[$n])){
list($date,$ip,$name,$msg)=explode("<$>",$all_msg[$n],4); //獲取留言內容
echo "<tr bgcolor=$bg>";
echo "<td width=14%>".$date."<br><b>".$name."</b></td>";
echo "<td width=86%>".$msg."</td>";
echo "</tr>";
}
}
?>

</table>
<table width="800" border="0" bordercolor="#88CCEE" cellspacing="0" cellpadding="4" style="border-collapse:collapse; word-break:break-all;font-size:12px">
<tr><td>
<p style="line-height: 100%; margin-top: 2; margin-bottom: 2" align="left">
<?php
if($prev>0)
echo "<a href=index.php?p=$prev>上一頁</a>";
else
echo "上一頁";
if($line_count>($next-1)*$perPage)
echo "<a href=index.php?p=$next>下一頁</a>";
else
echo "下一頁";
echo "當前第 ".$num." 頁,共有".$page_count."頁,".$line_count."條留言。";
?>
</p></td></tr>
</table>
<?php } ?>

file: savemsg.php
代碼:

<?php
$MSG_MAX_LEN=512; //留言最大長度
if (getenv("HTTP_CLIENT_IP"))
$ip= getenv("HTTP_CLIENT_IP");
elseif (getenv("HTTP_X_FORWARDED_FOR"))
$ip= getenv("HTTP_X_FORWARDED_FOR");
else
$ip= getenv("REMOTE_ADDR");
//獲取IP地址結束
$date=date("Y年m月d日 H:i:s",time());
if(empty($_POST['guest_name']))
die("請填你的名字。<a href=index.php>Refresh</a>");
if(empty($_POST['guest_msg']))
die("請填寫留言內容再提交。<a href=index.php>Refresh</a>");
$guest_name=strip_tags($_POST['guest_name']);
$guest_msg=substr($_POST['guest_msg'],0,$MSG_MAX_LEN);
//write message to file
//make the message be a line when stored
$guest_msg = str_replace( "\r\n", "\n", $guest_msg);
$guest_msg = str_replace( "\r", "\n", $guest_msg);
$guest_msg = str_replace(" "," ",$guest_msg);
$guest_msg = str_replace(">",">",$guest_msg);
$guest_msg = str_replace("<","<",$guest_msg);
$guest_msg = str_replace("\'","'",$guest_msg);
$guest_msg = nl2br($guest_msg);
//保存留言,以追加的形式
$fname="message.txt";
$fp=fopen($fname,"a+");
fwrite($fp,$date."<$>".$ip."<$>".$guest_name."<$>".$guest_msg."\n");
fclose($fp);
echo "<meta http-equiv='refresh' content='0;url=index.php'>";
?>

用於顯示效果的樣式表文件
file: msg.css
代碼:

A:link {
color: #0033FF;
text-decoration: none;
}

A:visited {
color: #0033FF;
text-decoration: none;
}

A:hover {
color: #30A300;
text-decoration: underline;
}

A:active {
color: #0036A9;
text-decoration: none;
}

BODY{
font-family: Verdana,Arial,Helvetica,sans-serif;
font-size: 12px;
background: #FBF9F9;
}

TABLE{
font-family: Verdana,Arial,Helvetica,sans-serif;
font-size: 12px;
border-collapse: collapse;
table-layout: fixed;
margin: 0px;
}

Ⅳ 求一個php的留言板源碼

<?php
$name= $_POST['name'];
$id=$_POST['id'];
$neirong=$_POST['neirong'];
try{
$mysql=mysql_connect("localhost",'sd','sd,')
}
cateh{}

Ⅳ asp簡單留言板源碼

我這有現成的ASP+ACCESS資料庫的簡單留言板源碼,我自己寫的,很簡單也很初級,裡面代碼不好看,但功能都實現了,可用於學習或學生畢業設計,因為我也是那時候寫的,呵呵~可加我扣,五七40四八11,我發給你

Ⅵ 最簡單php留言板源碼。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" " http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>無標題文檔</title>
</head>
<body>
<BR><BR>
<center><a href="admin_login.htm" target="_blank">留言管理</a> </center><BR><BR>
<br><br><br>
<form method="post" >
<p>姓名:
<input type="text" name="user_name" size="20">
</p>
<p><br>
電話:
<input type="text" name="user_tel" size="20">
</p>
<p><br>
留言:
<textarea name="user_post" rows="5" cols="20"></textarea>
</p>
<p>
<input type="submit" value="提交留言" name="Submit">

</p>
</form>
<br><br><br>
<font color="red">最新留言如下:<BR><BR></font>
<?php
if($_POST['Submit']){
$user_name=$_POST['user_name'];
$user_tel=$_POST['user_tel'];
$user_post=$_POST['user_post'];
$ah=$_POST['ah'];
$where=$_POST['where'];
$str.="姓名:".$user_name."\r\n電話:".$user_tel."\r\n留言:".$user_post;
$k=fopen("liuyanban.txt","w+");
fwrite($k,$str);
fclose($k);
echo "保存成功!";
}
?>
</body>
</html>

Ⅶ 求PHP留言板源碼,要有注冊登錄功能的,簡單實現就好

免費的可以在源碼網站找找我們也可以定做PHP+MYSQL製作

Ⅷ php+mysql留言板的源代碼

有視頻,你可以跟著做。要加什麼功能還可以自己發揮。。。

Ⅸ 求用C或C++寫的留言板源代碼,謝謝!

這個是我用c++寫的
#include<iostream>
#include"fstream"
using namespace std;
class Message
{
public:
char msg[200];
friend ostream & operator<<(ostream &out,Message &s);
friend istream & operator>>(istream &in,Message &s);
};
ostream & operator<<(ostream &out,Message &s)
{
out<<s.msg<<'\n';
return out;
}
istream & operator>>(istream &in,Message &s)
{
in>>s.msg;
return in;
}
int main()
{
ofstream ofile;
ifstream ifile;
Message s;
ifile.open("message.txt");
if(ifile.fail())
{
ofile.open("message.txt");
cout<<"這是一個留言程序,請留言:"<<endl;
cin>>s;
ofile<<s;
ofile.close();ifile.close();
}
else
{
cout<<"留言內容是:"<<endl;
ifile>>s;
while(!ifile.eof())
{
cout<<s;
ifile>>s;
}
ifile.close();
for(;;)
{
int option;
cout<<"please choose:"<<endl
<<"1-------------------add message"<<endl
<<"2-------------------cover ever message"<<endl
<<"3-------------------print message"<<endl
<<"0-------------------exit"<<endl;
cin>>option;
switch(option)
{
case 1:
ofile.open("message.txt",ios::app);
cout<<"please input a message:"<<endl;
cin>>s;
ofile<<s;
ofile.close();
break;
case 2:
ofile.open("message.txt",ios::trunc);
cout<<"please input a message:"<<endl;
cin>>s;
ofile<<s;
ofile.close();
break;
case 3:
ifile.open("message.txt");
ifile>>s;
while(!ifile.eof())
{
cout<<s;
ifile>>s;
}
ifile.close();
break;
case 0:
ofile.close();
return 0;
}
}
}
return 0;
}

Ⅹ 完整的php&mysql的留言板源代碼,可以運行的

input.htm

<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>input</title>
</head>

<body>

<form method="POST" action="receive.php">

<p>您的姓名: <input type="text" name="T1" size="20"></p>
<p>您的性別:男<input type="radio" value="0" name="R1">
女<input type="radio" name="R1" value="1"></p>
<p>您的EMAIL:<input type="text" name="T2" size="35"></p>
<p>您的留言內容:</p>
<p> <textarea rows="16" name="S1" cols="45"></textarea></p>
<p> </p>
<p> <input type="submit" value="提交" name="B1">
<input type="reset" value="重置" name="B2"></p>
</form>

</body>

</html>

receive.php

<?php
$user='root';
$password='123';
$db='guestbook';
$table='gbook';
$ip=getenv(REMOTE_ADDR);
$sql = "INSERT INTO `guestbook`.`gbook` (`id`, `name`, `sex`, `email`, `info`, `ip`, `time_at`) VALUES (NULL, '$T1', '$R1', '$T2', '$S1', '$ip', NOW());";

$connect=mysql_connect('localhost',$user,$password);
mysql_select_db($db);
mysql_query($sql);
$result=mysql_query("select * from $table");
while ($arr=mysql_fetch_array($result))
{
if ($arr[2]==0)
$gender='先生';
else
$gender='女士';

?>
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Receive</title>
</head>

<body style="background-attachment: fixed">

<table border="1" width="100%" id="table1" bgcolor="#FFFFFF">
<tr>
<td bordercolor="#FFFFFF" bgcolor="#C0C0C0"><?=$arr[6]?>(<?=$arr[5]?>)<p><?=$arr[1]?> <?=$gender?><<a href="<?=$arr[3]?>"><?=$arr[3]?></a>>
寫到:</td>
</tr>
<tr>
<td><?=$arr[4]?><p> </p>
<p><a href="del.php?id=<?=$arr[0]?>">[刪除]</a>
<a href="modify.php?id=<?=$arr[0]?>">[修改]</a>]</td>
</tr>
</table>

</body>

</html>
<?php
echo '<p>';
echo '<p>';
}
?>
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建網頁 1</title>
</head>

<body>

<p><a href="input.htm"><繼續留言></a></p>

</body>

</html>

del.php

<?php
$user='root';
$password='123';
$db='guestbook';
$table='gbook';
$sql="DELETE FROM $table WHERE id=$id";
$connect=mysql_connect('localhost',$user,$password);
mysql_select_db($db);
$result=mysql_query($sql);
if ($result)
echo "刪除成功";
else
echo "刪除失敗";
?>
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建網頁 1</title>
</head>

<body>

<p><a href="receive.php"><返回首頁></a></p>

</body>

</html>

modify.php

<?php
$user='root';
$password='123';
$db='guestbook';
$table='gbook';
$ip=getenv(REMOTE_ADDR);
$connect=mysql_connect('localhost',$user,$password);
mysql_select_db($db);
$result=mysql_query("select * from $table where id=$id");
$arr=mysql_fetch_array($result);
?>

<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>input</title>
</head>

<body>

<form method="POST" action="modify_ok.php?id=<?=$id?>">

<p>您的姓名: <input type="text" name="T1" size="20" value="<?=$arr[1]?>"></p>
<p>您的性別:
<?php
if ($arr[2]==0) echo '男<input type="radio" value="0" name="R1" checked>
女<input type="radio" name="R1" value="1"></p>';
else echo '男<input type="radio" value="0" name="R1">
女<input type="radio" name="R1" value="1" checked></p>';
?>
<p>您的EMAIL:<input type="text" name="T2" size="35" value="<?=$arr[3]?>"></p>
<p>您的留言內容:</p>
<p> <textarea rows="16" name="S1" cols="45" ><?=$arr[4]?></textarea></p>
<p> </p>
<p> <input type="submit" value="修改" name="B1">
<input type="reset" value="重置" name="B2"></p>
</form>

</body>

</html>

modify_ok.php

<?php
$user='root';
$password='123';
$db='guestbook';
$table='gbook';
$connect=mysql_connect('localhost',$user,$password);
mysql_select_db($db);;
$sql = "UPDATE `guestbook`.`gbook` SET `name` = '$T1', `sex` = '$R1', `email` = '$T2', `info` = '$S1' WHERE `gbook`.`id` = '$id' LIMIT 1;";
$result=mysql_query($sql);
if ($result)
echo "修改成功";
else
echo "修改失敗";

?>
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建網頁 1</title>
</head>

<body>

<p><a href="input.htm"><繼續留言></a></p>

</body>

</html>

熱點內容
c語言和vc的區別 發布:2024-11-15 16:19:23 瀏覽:118
linux是免費的嗎 發布:2024-11-15 15:53:44 瀏覽:616
多控存儲 發布:2024-11-15 15:52:42 瀏覽:282
一年級數學分解演算法 發布:2024-11-15 15:41:08 瀏覽:410
安卓個人熱點怎麼分享 發布:2024-11-15 15:40:16 瀏覽:263
墊錢解壓 發布:2024-11-15 15:38:54 瀏覽:335
miui4相當於安卓什麼系統 發布:2024-11-15 15:37:54 瀏覽:708
rc4android 發布:2024-11-15 15:27:25 瀏覽:741
電腦伺服器機箱圖片 發布:2024-11-15 15:27:18 瀏覽:114
網頁緩存文件提取 發布:2024-11-15 15:24:42 瀏覽:144