A simple php& from the classics MySQL message board 1th/4 page _php Tutorial

Source: Internet
Author: User
Table One: admin
Field: ID (int11) name (VARCHVR) password (VARCHVR)

Table II: 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 Database
mysql_select_db ("Lyb");//Select Database
?>

2. header.php (Common header file)
Copy CodeThe code is as follows:




<title>Silver Message Board Version 1.0</title>






    • I want to see the message

    • I want to publish

    • Session_Start ();
      if ($_session["key"]==1) {//If the obtained SESSION is 1, the management item is displayed
      ?>
    • Exit management

    • }
      Else
      {
      ?>
    • I want to manage




Silver Message Board Version 1.0


3. footer.php (Common bottom file)
Copy CodeThe code is as follows:
$counterFile = "Conter.xml";
function Displaycounter ($counterFile) {
$fp = fopen ($counterFile, "RW");
$num = Fgets ($fp, 5);
$num + = 1;
Print "Silver Message Board Version 1.0 You are the first". " $num "." Bit of boring silver ";
EXEC ("Rm-rf $counterFile");
EXEC ("echo $num > $counterFile");
}
if (!file_exists ($counterFile)) {
EXEC ("Echo 0 > $counterFile");
}
Displaycounter ($counterFile);
?>




http://www.bkjia.com/PHPjc/318736.html www.bkjia.com true http://www.bkjia.com/PHPjc/318736.html techarticle table One: admin field: ID (int11) name (VARCHVR) password (VARCHVR) Table II: Lo field: ID (int11) Username (VARCHVR) Sex (VARCHVR) QQ (VARCHVR ) Email (VARCHVR) info (text) IP (VARCHVR) submit_time (DateTime ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.