PHP make text message board, PHP text message board _php tutorial

Source: Internet
Author: User

PHP make text message board, PHP text message board


The code is simple, not much nonsense, directly on the code:

del.php

Copy the Code code as follows:



My message board



<?php include ("menu.php");?>

Delete message


<?php
$id =$_get["id"];
$info =file_get_contents ("Liuyan.txt");
$lylist =explode ("@@@", $info);
Unset ($lylist [$id]);
$ninfo =implode ("@@@", $lylist);
File_put_contents ("Liuyan.txt", $ninfo);
$alert = "alert (' Delete succeeded! ')";
echo "";
?>



doadd.php

Copy the Code code as follows:



My message board



<?php include ("menu.php");?>

Add message


<?php
Get information about the message board
$title =$_post["title"];
$author =$_post["Author"];
$content =$_post["Content"];
$time =time ();
$ip =$_server["REMOTE_ADDR"];
$ly = "{$title}##{$author}##{$content}##{$time}##{$ip}@@@";
Echo $ly;
$ly = $ly. file_get_contents ("Liuyan.txt");
File_put_contents ("Liuyan.txt", $ly);
$alert = "alert (' Message successful! Thank you! ')";
echo ";"
?>



index.php

Copy the Code code as follows:



My message board



<?php include ("menu.php");?>

Add message






Liuyan.txt

Copy the Code code as follows:
Soothing ##### #1426588557 # #127.0.0.1@@@

show.php

Copy the Code code as follows:



My message board



<?php include ("menu.php");?>

Add message

































<?php $info =file_get_contents ("Liuyan.txt"); if ($info ==null) {$alert = "alert (' No message! ')"; echo "";} else{$info =rtrim ($info, "@"), $lylist =explode ("@@@", $info), foreach ($lylist as $key + = $v) {$ly =explode ("# #", $v); EC Ho " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; } } ? >
Message title Message Person Message Content Message Time IP Address Operation
$ly [0]$ly [1]$ly [2]". Date (" Y-m-d h:i:s ", $ly [3]+8*3600)."$ly [4]Delete




menu.php

Copy the Code code as follows:

My message board


Add message
View Message

The above mentioned is the whole content of this article, I hope you can like.

http://www.bkjia.com/PHPjc/969493.html www.bkjia.com true http://www.bkjia.com/PHPjc/969493.html techarticle PHP Production text message board, PHP text message board code is very simple, not much nonsense, directly on the code: del.php Copy Code code as follows: HTML head meta charset= "Utf-8" Titl ...

  • 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.