将表单条目提交到数据库并重定向到同一页面

问题描述:

如何将表单条目提交到数据库并重定向到同一页面,条目仍显示在表单的字段中?我真的需要帮助。谢谢。

How do I submit form entries to the database and redirect to the same page, with the entries still display on the fields of the form? I really need help on this. Thanks.


如何将表单条目提交到数据库并重定向到同一页面,条目仍然显示在表单的字段上?我真的需要帮助。谢谢。
How do I submit form entries to the database and redirect to the same page, with the entries still display on the fields of the form? I really need help on this. Thanks.



这是一个非常大的话题,有无穷无尽的可能性,但这里有一个小片段。


这里是基本的想法。


1.使用

This is a really big topic and there are endless possibilities, but here is a little snippet for you.

Here is the basic idea.

1. use


_SERVER [''PHP_SELF'']作为你脚本的动作,这样你才能回来提交表单时到同一页面。

2.如果
_SERVER[''PHP_SELF''] as the action of your script so that you come back to the same page when you submit the form.
2. if


_POST变量已设置,则处理它们将它们放入数据库。然后分配
_POST variables are set then process them put them in your database. then assign the