当前位置:首页 > 网站模板 > 正文内容

留言板html模板源代码(留言板html源码下载)

网站模板2年前 (2023-02-12)529

今天给各位分享留言板html模板源代码的知识,其中也会对留言板html源码下载进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!

本文目录一览:

完整的php&mysql的留言板源代码,可以运行的

input.htm

html

head

meta http-equiv="Content-Language" content="zh-cn"

meta http-equiv="Content-Type" content="text/html; charset=gb2312"

titleinput/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"

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

pa 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

pa 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

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

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

pa href="input.htm"继续留言/a/p

/body

/html

HTML做出来了一个留言板界面,但是想要实现功能还需要怎么操作???

简单易懂的就选php(因为我就懂这个哈哈~),用php的话你需要网上下载一个wamp,安装,一般安装在随便一个盘的根目录下,如D:/这样。比如你装在D盘,那么在D盘的根目录会生成一个wamp文件夹,这个文件夹里面有个www文件夹,www里面就是你要写代码放的地方,然后你打开浏览器,输入网址:localhost或者127.0.0.1,出现php界面应该就是安装成功了。你注意电脑屏幕右下角有个绿色的W标志,就是成功啦~

接下来就是编写php语言用来连接数据库啦

求静态HTML留言板程序!

这个是及其简单的聊天

html

head

meta http-equiv="Content-Type" content="text/html; charset=utf-8"

title简单聊天/title

style

* {

font-size:12px;

margin:0;

padding:0;

}

fieldset {

padding:10px;

margin:10px;

width:270px;

color:#333;

border:#06c dashed 1px;

}

legend {

color:#06c;

font-weight:800;

background:#fff;

text-align:center

}

ul {

list-style-type: none;

margin:8px 0 4px 0;

}

li {

margin-top:4px;

}

/style

script type="text/javascript"

function Trim(text)//去左右空格

{

return text.replace(/^\s+|\s+$/g,"");

}

function sendTxt()

{

if (Trim(document.getElementById("txtSendContent").value)=="")

{

alert("输入的内容为空!");

document.getElementById("txtSendContent").focus();

return false;

}

document.getElementById("ulContent").innerHTML+="font color='red'me say/font\r\n:li"+getPic(document.getElementById("txtSendContent").value)+"/li\r\n";

}

function getPic(text)

{

text=text.replace(/:\)/gim,"img src='images/QQ/smile.gif' border='0' width='24' height='24'");

text=text.replace(/:\(/gim,"img src='images/QQ/cry.gif' border='0' width='24' height='24'");

text=text.replace(/:-\(/gim,"img src='images/QQ/cry.gif' border='0' width='24' height='24'");

text=text.replace(/:-\)/gim,"img src='images/QQ/smile.gif' border='0' width='24' height='24'");

text=text.replace(/:)/gim,"img src='images/QQ/smile.gif' border='0' width='24' height='24'");

//var pattern=new RegExp("\

","gim");

text=text.replace(/\

([^\[]*)([^\[]*)\[\/img]/gim,"img src='images/QQ/$2' border='0' width='19' height='19'");

text=text.replace("\r\n","br");

return text;

}

function choosePic()

{

var returnValue=window.showModalDialog('emot.htm',null,'dialogHeight:240px;dialogWidth:300px');

document.getElementById("txtSendContent").value+=returnValue;

}

function test()

{

var ss = "Is is the cost of of gasoline going up up?.\n";

var re = /\b([a-z]+) \1\b/gim; //创建正则表达式样式.

var rv = ss.replace(re,"$1"); //用一个单词替代两个单词.

alert(rv);

}

/script

/head

body style="text-align:center"

fieldset style="width:326px"

legend消息显示区/legend

ul id="ulContent" style="text-align:left"

/ul

/fieldset

br

fieldset

legend消息发送区/legend

form name="form1" method="post" action=""

label

textarea name="txtSendContent" id="txtSendContent" cols="40" rows="10"/textarea

/label

label

input type="button" name="button" id="button" value="发送" onClick="return sendTxt();"

input type="button" name="button" id="button" value="test" onClick="return test();"

/label

img src="images/QQ/smile.gif" alt="选择表情符" title="选择表情符" style="cursor:hand" width="24" height="24" onClick="return choosePic();"

/form

/fieldset

/body

/html

关于留言板html模板源代码和留言板html源码下载的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。

扫描二维码推送至手机访问。

版权声明:本文由我的模板布,如需转载请注明出处。


本文链接:http://sdjcht.com/post/3578.html

分享给朋友:

“留言板html模板源代码(留言板html源码下载)” 的相关文章

dw网页制作自我介绍(dw网页设计自我介绍)

dw网页制作自我介绍(dw网页设计自我介绍)

今天给各位分享dw网页制作自我介绍的知识,其中也会对dw网页设计自我介绍进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!本文目录一览: 1、谁能用Dreamweaver帮我做个做...

用word制作会议标准姓名桌牌(用word制作会议标准姓名桌牌图片)

用word制作会议标准姓名桌牌(用word制作会议标准姓名桌牌图片)

今天给各位分享用word制作会议标准姓名桌牌的知识,其中也会对用word制作会议标准姓名桌牌图片进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!本文目录一览: 1、怎么用word...

ps里面怎么拼图(ps怎么拼图排版4张图片)

ps里面怎么拼图(ps怎么拼图排版4张图片)

本篇文章给大家谈谈ps里面怎么拼图,以及ps怎么拼图排版4张图片对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。 本文目录一览: 1、ps怎么拼图 2、怎么利用PS制作拼图 3、phot...

ppt模板免费下载素材彩虹(ppt模板免费下载素材彩虹图)

ppt模板免费下载素材彩虹(ppt模板免费下载素材彩虹图)

今天给各位分享ppt模板免费下载素材彩虹的知识,其中也会对ppt模板免费下载素材彩虹图进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!本文目录一览: 1、好看的ppt 模板...

电脑怎么弄PPT模板(电脑上怎么用ppt模板)

电脑怎么弄PPT模板(电脑上怎么用ppt模板)

今天给各位分享电脑怎么弄PPT模板的知识,其中也会对电脑上怎么用ppt模板进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!本文目录一览: 1、怎么在电脑上面下载ppt模板?...

论文模板word下载(论文模板下载免费)

论文模板word下载(论文模板下载免费)

今天给各位分享论文模板word下载的知识,其中也会对论文模板下载免费进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!本文目录一览: 1、毕业论文写作格式是什么 字体要求是什么...