To write the form content submitted in php to different files, how can this problem be solved?

Source: Internet
Author: User
I want to write the form content submitted in php to different files. I am still working on that message board. I want to save different messages to different texts. & nbsp; however, after the submitted form is submitted, a PHP file will be executed every time. I want to execute this php file once, and there is a variable in it that will be incremented, & nbsp; which variable in php can implement this function ?? & Nbsp; how can I pass the variable of a php file to another php file in php? Thank you for writing the form content submitted in php to different files.
I am still working on the message board. I want to save different messages to different texts.
However, after the submitted form is submitted, a PHP file will be executed every time,
There is a variable in it that is incremented,
Which variable in php can implement this function ??
In addition, how can I pass the variable of a php file to another php file in php?




Thank you! I am too unfamiliar with php.






------ Solution --------------------
Save the variable in the database or memcache.
------ Solution --------------------
Global variables
Session_start ();
$ _ SESSION ['var'] = $ _ SESSION ['var'] + 1;

You can use cookies if most of the data is used.
If the data volume is large, you can use the database.

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.