How to implement PHP into data program _php tutorial

Source: Internet
Author: User

PHP Add Data program code:

  1. $ Date Date =date ("y-m-d h:i:s");
  2. Get system time
  3. $ IP = $HTTP _server_vars[remote_addr];
  4. IP address of the speaker
  5. $ text = encode ($GB _text);
  6. Remove the space following the message.
  7. $ FP = fopen ("Gb.dat", "a");
  8. Opens the Gb.dat text file in write-only mode with the file pointer pointing 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 data of all the messages to the variable $str, "|" The purpose of this is to use the data interval symbol for future data segmentation.
  11. Fwrite ($fp, $STR);
  12. Writing data to a file
  13. Fclose ($FP);
  14. Close File
  15. ShowMessage ("Message success!", "index.php", "3″");
  16. 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 ...

  • 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.