Home > Backend Development > PHP Tutorial > From the classic Creating a Simple PHP&MYSQL Message Board Page 1/4_PHP Tutorial

From the classic Creating a Simple PHP&MYSQL Message Board Page 1/4_PHP Tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-21 15:53:24
Original
1136 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 (connection database file)

Copy codeThe code is as follows:

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

2. header.php (public header file)
Copy code The code is as follows:





Silver Message Board Version 1.0

< link href="css.css" rel="stylesheet" type="text/css" />




3. footer.php (public bottom file)



Copy code

The 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);
?>





www.bkjia.comtruehttp://www.bkjia.com/PHPjc/318736.htmlTechArticle表一:admin 字段:id(int11)name(varchvr)password(varchvr) 表二:lo 字段:id(int11)username(varchvr)sex(varchvr)qq(varchvr)email(varchvr)info(text)ip(varchvr)submit_time(datetime...
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template