PHP data adding program code:
- $date date=date(”Y-m-d H:i:s”);
- //Get system time
-
$ip = $HTTP_SERVER_VARS[REMOTE_ADDR];
- //Get the IP address of the speaker
-
$text=encode($gb_text);
- //Remove the spaces after the message content.
- $fp=fopen("gb.dat", "a");
- //Open 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 messages to the variable $str. The purpose of "|" is to use it as the data interval symbol when dividing data in the future.
- fwrite($fp,$str);
- //Write data to file
- fclose($fp);
- //Close the file
- showmessage("Message successfully!","index.php", "3");
- //Leave a message successfully and automatically return to the main interface after 3 seconds.
$gb_name, $gb_email, $gb_home, $face, $gb_qq, $head, $gb_text, $reply in the code of the PHP data program are generated by the speech form transmitted data.
http://www.bkjia.com/PHPjc/446134.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/446134.htmlTechArticlePHP data adding program code: $ date date =date(Y-m-dH:i:s); //Get System time$ ip =$HTTP_SERVER_VARS[REMOTE_ADDR]; //Get the speaking IP address$ text = encode ($gb_text); //Remove...
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn