Message from the message board owner with flash words from the classic Creating a Simple PHP&MYSQL Message Board Page 1/4

WBOY
Release: 2016-07-29 08:37:46
Original
1336 people have browsed it

Table 1: admin
Field: id(int11) name(varchvr) password(varchvr)
Table 2: lo
Field: id(int11) username(varchvr) sex(varchvr) qq(varchvr) email(varchvr) info(text ) ip(varchvr) submit_time(datetime)
1. conn.php (connect database file)

Copy codeThe code is as follows:


mysql_connect("localhost","root"," ");//Connect to the database
mysql_select_db("lyb");//Select the database
?>


2, header.php (public header file)

Copy the codeThe code is as follows:



< html xmlns="http://www.w3.org/1999/xhtml">

Copy the codeThe code is as follows:


$counterFile="conter.xml";
function displayCounter($counterFile){
$fp = fopen($counterFile,"rw");
$num = fgets($fp,5);
$num += 1;
print "

";
exec( "rm -rf $counterFile");
exec("echo $num > $counterFile");
}
if(!file_exists($counterFile)){
exec("echo 0 > $counterFile");
}
displayCounter($counterFile);
?>



Current 1/4 page 1234Next page

The above introduces the message board owner’s message flash text from the classic Creating a Simple PHP&MYSQL Message Board Page 1/4, which includes the message board owner’s message flash character. I hope it will be helpful to friends who are interested in PHP tutorials.

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!