PHP is used to add data programs. PHP joins the data program code: $ datedatedate (Y-m-dH: I: s); gets the system time $ ip $ HTTP_SERVER_VARS [REMOTE_ADDR]; get the IP address $ textencode ($ gb_text); remove
Code for adding a data program to PHP:
- $ Datedate = date ("Y-m-d H: I: s ");
- // Obtain the system time
- $ Ip = $ HTTP_SERVER_VARS [REMOTE_ADDR];
- // Obtain the IP address of the speaker
- $ Text = encode ($ gb_text );
- // Remove the spaces behind the message content.
- $ Fp = fopen ("gb. dat", "");
- // Open the gb. dat text file in write-only mode. the file pointer points to the end of the file.
- $ Str = $ ip. "| ". $ date. "| ". $ gb_name. "| ". $ gb_email. "| ". $ gb_home. "| ". $ face. "| ". $ gb_qq. "| ". $ head. "| ". $ text. "| ". $ reply. "n ";
- // Assign the variable $ str, "|" to the data interval symbol used for data segmentation in the future.
- Fwrite ($ fp, $ str );
- // Write data to a file
- Fclose ($ fp );
- // Close the file
- Showmessage ("message successful !"," Index. php "," 3 ″);
- // Message Success. The message is automatically returned to the main interface 3 seconds later.
The $ gb_name, $ gb_email, $ gb_home, $ face, $ gb_qq, $ head, $ gb_text, and $ reply values in the PHP code added to the data program are data transmitted from the speech form.
Required $ date = date (Y-m-dH: I: s); // Obtain the system time $ ip = $ HTTP_SERVER_VARS [REMOTE_ADDR]; // get the IP address $ text = encode ($ gb_text); // remove...