PHP页面表单处理函数和表单在一个页面上好吗?解决办法

WBOY
Release: 2016-06-13 10:22:06
Original
861 people have browsed it

PHP页面表单处理函数和表单在一个页面上好吗?
现有一表单,接受所输入的各个数据。比如有name和address两项,PHP代码负责将其写入数据库中,请问处理该过程的php代码是放在表单所在的页面,还是单独写一个Insert.php文件?这两种方式哪个更好些?请指教。

------解决方案--------------------
都行。要想结构清晰点。就单独写一个文件。
------解决方案--------------------
都一样
分开来写,功能单一、代码清晰,修改麻烦
合起来写,代码稍显复杂,修改方便。

------解决方案--------------------
分开比较好,比较清晰
------解决方案--------------------
最好分开来写。如果你用chrome浏览器的话,混在一起写每次刷新都会提示你是否想要重复提交表单,用户体验不好。
------解决方案--------------------

探讨

都一样
分开来写,功能单一、代码清晰,修改麻烦
合起来写,代码稍显复杂,修改方便。
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!