PHP simple guestbook function implementation code

不言
Release: 2023-03-29 07:28:02
Original
1230 people have browsed it

This article mainly introduces the implementation code of PHP simple guestbook function in detail. It has certain reference value. Interested friends can refer to it.

The example in this article shares with you the PHP message. The specific code of this function is for your reference. The specific content is as follows

index.php

$pageCount) //如果输入的页数超过总页数则默认跳转到最后一页 { $currpage=$pageCount; } ?>                 

条留言

  • 留言标题
  • 用户网名
  • 时间

留言内容:


    «"; } } ?> $i"; }else{ echo "
  • $i
  • ";} } ?> »"; } } ?>


发表留言
留言标题:
网名:
留言内容:

Copy after login

conn.php

Copy after login

result.php

",str_replace(" "," ",$content)); //显示'空格'和'回车' $week = '星期'.mb_substr( "日一二三四五六",date("w"),1,"utf-8" );     $isok =mysql_query("insert into guestlist(title,username,content,addtime)values('$title','$username','$content','".date("Y-m-d H:i:s")." $week ')"); if($isok) { echo ""; }else { echo ""; } ?>
Copy after login

css /index.css

body{margin:0;padding:0;} ul,li{list-style: none;margin:0;padding:0;} a{text-decoration: none;} .content{ width:800px; margin:0 auto; } .bt{ width:799px; height:20px; text-align: center; background:#EB9316; margin:0 0 5px 0; } .bt>li{ float:left; width:265px; height:20px; text-align: center; line-height: 20px; font-size:13px; } .nr{ float:left;          /*如果不浮动 后面的lynr会受影响*/ width:799px; height:20px; text-align: center; background:#B9DEF0; } .nr>li{ float:left; width:265px; height:20px; text-align: center; line-height: 20px; font-size:13px; } .lynr{ float:left; /*如果不浮动会 布局会乱*/ width:800px; margin:1px 0 1px 0; } .content p{ width:70px; height:50px; float:left; } .content span{ display: block; width:710px; float:left; } td{ width:80px; padding:5px 0; /*border: 1px solid #79ABFE;*/ } td input,textarea{ border: 1px solid #79ABFE; } /*tr{ display:block;       /*将tr设置为块体元素 显示块状后 就将其包围住了 不是一个矩形了 }*/
Copy after login

dist/css/bootstrap.min.css(Download by yourself)

Rendering:

Related recommendations:

PHP SimpleMethods to implement the member retrieval password function

The above is the detailed content of PHP simple guestbook function implementation code. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!