在 php 中制作一个表单,保存用户提供的信息,并将其插入另一个可打印页面
我正在开发一个网站,该网站为该网站的用户提供预先写好的信件以发送到各个地方。用户所要做的就是填写表格并点击继续,然后用户在表格中输入的任何信息(例如姓名)都会被插入到可打印页面上预先写好的字母中。一个基本的例子是,如果表单要求输入姓名,那么您点击“继续”,在可打印页面上,它会说:
嗨,我的名字是扎克。
我正在使用基于 php 的内容管理系统,因此它应该在 php 中。我知道对于那些知道如何做的人来说这是一件非常简单的事情,但不幸的是我不知道。预先感谢您的帮助!
I'm working on a site that gives the users of the site pre-written letters to send to places. All the user has to do is fill out a form and hit continue, then whatever information the user put into the form (like name for example) gets plugged into a pre-written letter on a printable page. A basic example would be if the form asks for Name then you hit continue, on the printable page, it would say:
Hi, my name is Zach.
I'm using a php based content management system so it should be in php. I know this is a very simple thing to do for those who know how to do it, I unfortunately don't. Thank you in advance for your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设您有这样的表单:
当您点击提交时,所有字段的值(在本例中为输入,还有文本区域、选择等)都将保存到 POST 数组(如果设置 method="GET" 则为 GET)。
您可以使用如下代码从 Preview.php 页面(在本例中您要在其中打印名称)访问 POST 和 GET 数组:
Suppose you have this form:
When you hit submit, the values of all the fields (input in this case, but also textarea, selects, etc) are save to the POST array (or GET if you set method="GET").
You access the POST and GET arrays from the preview.php page (where you want to print the name in this example) with code like this:
在你的第一页中:
然后在 letter.php 中执行以下操作:
可以吗? :)
in your first page:
Then in letter.php do this:
That ok? :)