Is the PHP page form processing function and form on the same page? Solution
Source: Internet
Author: User
Is the PHP page form processing function and form on the same page? There is a form that accepts all input data. For example, if there are two items: name and address, the PHP code is responsible for writing them into the database. Will the php code processing this process be placed on the page where the form is located, or is it a separate Insert. PHP file? Which of the two methods is better? Please advise ., Yes. The structure should be clear. Write a file separately ., Are all PHP page form processing functions and forms on the same page?
There is a form that accepts all input data. For example, if there are two items: name and address, the PHP code is responsible for writing them into the database. Will the php code processing this process be placed on the page where the form is located, or is it a separate Insert. PHP file? Which of the two methods is better? Please advise.
------ Solution --------------------
Yes. The structure should be clear. Write a file.
------ Solution --------------------
Same
Independent writing, single function, clear code, and difficult to modify
The code is slightly complex and easy to modify.
------ Solution --------------------
Better separation and clarity
------ Solution --------------------
It is best to write data separately. If you use chrome, writing and refreshing together will prompt you if you want to submit the form repeatedly. the user experience is poor.
------ Solution --------------------
Discussion
Same
Independent writing, single function, clear code, and difficult to modify
The code is slightly complex and easy to modify.
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.