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
Message title |
Message Person |
Message Content |
Message Time |
IP Address |
Operation |
<?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 "
$ly [0] | "; echo "
$ly [1] | "; echo "
$ly [2] | "; echo "
". Date (" Y-m-d h:i:s ", $ly [3]+8*3600)." | "; echo "
$ly [4] | "; echo "
Delete | "; echo "
"; } } ? >
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.