PHP Add Data program code:
- $ Date Date =date ("y-m-d h:i:s");
- Get system time
- $ IP = $HTTP _server_vars[remote_addr];
- IP address of the speaker
- $ text = encode ($GB _text);
- Remove the space following the message.
- $ FP = fopen ("Gb.dat", "a");
- Opens the Gb.dat text file in write-only mode with the file pointer pointing to the end of the file.
- $ Str = $ip. "|". $date. "|". $GB _name. "|". $GB _email. "|". $GB _home. "|". $face. "|". $GB _qq. "|". $head. "|". $text. "|". $reply. " n ";
- Assign the data of all the messages to the variable $str, "|" The purpose of this is to use the data interval symbol for future data segmentation.
- Fwrite ($fp, $STR);
- Writing data to a file
- Fclose ($FP);
- Close File
- ShowMessage ("Message success!", "index.php", "3″");
- The message is successful and automatically returns to the main screen after 3 seconds.
$gb_name, $GB _email, $GB _home, $face, $GB _qq, $head, $GB _text, $reply are the data that is only son from the statement table in the code of the PHP data program.
http://www.bkjia.com/PHPjc/446134.html www.bkjia.com true http://www.bkjia.com/PHPjc/446134.html techarticle PHP Add Data program code: $ date Date =date (y-m-dh:i:s);//Get system Time $ IP = $HTTP _SERVER_VARS[REMOTE_ADDR];//Get spoke IP address $ text = encode ($GB _text); Get rid of ...