Database structure: (database name: lyb) Table 1: admin field: id (int11) name (varchvr) password (varchvr) Table 2: lo field: id (int11) username (varchvr) * ** (varchvr) qq (varchvr) email (varchvr) info (text)
Database structure: (database name: lyb)
Table 1: admin
Field: id (int11) name (varchvr) password (varchvr)
Table 2: lo
Field: id (int11) username (varchvr) *** (varchvr) qq (varchvr) email (varchvr) info (text) ip (varchvr) submit_time (datetime)
1 conn. php (connect to the database file)
Mysql_connect ('localhost', 'root', ''); // connect to the database
Mysql_select_db ('lyb'); // select a database
?>
2 header. php (public header file)
PHP and MYSQL work together to create a simple message book program
- Even check the message
- Even post
Session_start ();
If ($ _ SESSION ['key'] = 1) {// if the obtained SESSION is 1, the governance item is displayed.
?>
- Exit governance
}
Else
{
?>
- Governance
PHP and MYSQL work together to create a simple message book program
3 footer. php (public bottom file)
$ CounterFile = 'conter. XML ';
Function displayCounter ($ counterFile ){
$ Fp = fopen ($ counterFile, 'rw ');
$ Num = fgets ($ fp, 5 );
$ Num = 1;
Print 'simple message board you are the '.' $ num'. 'bit boring silver ';