How to add a Data Program to PHP

Source: Internet
Author: User

Code for adding a Data Program to PHP:

  1. $ Datedate = date ("Y-m-d H: I: s ");
  2. // Obtain the system time
  3. $ Ip = $ HTTP_SERVER_VARS [REMOTE_ADDR];
  4. // Obtain the IP address of the speaker
  5. $ Text = encode ($ gb_text );
  6. // Remove the spaces behind the message content.
  7. $ Fp = fopen ("gb. dat", "");
  8. // Open the gb. dat text file in write-only mode. The file Pointer Points to the end of the file.
  9. $ Str = $ ip. "| ". $ date. "| ". $ gb_name. "| ". $ gb_email. "| ". $ gb_home. "| ". $ face. "| ". $ gb_qq. "| ". $ head. "| ". $ text. "| ". $ reply. "n ";
  10. // Assign the variable $ str, "|" to the data interval symbol used for data segmentation in the future.
  11. Fwrite ($ fp, $ str );
  12. // Write data to a file
  13. Fclose ($ fp );
  14. // Close the file
  15. Showmessage ("message successful !"," Index. php "," 3 ″);
  16. // 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.
 


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.