PDF表格提交 [英] PDF form submission
问题描述
我有一个PDF格式的表单(用Acrobat制作),它具有通过HTTP提交的按钮。我想做的事情有一个PHP脚本,它将采取PDF格式并通过附件通过电子邮件发送给我。
我不想要的:
p> - PDF通过电子邮件提交按钮。这要求网络邮件用户保存pdf并附加它,对于大多数用户来说太混乱了。我想点击一下就完成了。
- 通过mailto:email@address.com提交。与上面相同。
如果服务器上有pdf,我知道如何使用PHP的mail()函数将它发送给某人。我不知道该怎么做,只要有人点击PDF中的提交,就可以处理PDF。
这是否合理?
谢谢,
Jeff
我认为我解决了它。在另一个论坛上找到答案,但必须记得在我的服务器上设置写权限。
<?php
$ fileatt = date(dmY-His)。 .PDF; //创建唯一的PDF名称
copy('php:// input',$ fileatt); //将POST数据复制到pdf文件
?>
确保PDF按钮被设置为发送数据为PDF而不是HTTP Post data / p>
表单将发送一个空白的PDF回给用户...但是您可以通过执行任何您想要的回应
header('Location:your_return_form.pdf');
(或重新指向另一个网页,或其他)
仍然有一些扭曲,但我认为大部分都适用。
I have a PDF form (made in Acrobat) that has button to submit via HTTP. What I want to do it have a PHP script that will take the PDF form and e-mail it to me via attachment.
What I don't want:
--PDF Submit via e-mail button. This requires webmail users to save the pdf and attach it, and is just too confusing for most users. I want one-click and done.
--Submit via mailto:email@address.com. Does the same thing as above.
If there's a pdf on the server, I know how to use PHP's mail() function to e-mail it to someone. What I don't know how to do is process the PDF once someone hits Submit within the PDF.
Does that make sense?
Thanks, Jeff
I think I fixed it. Found the answer on another forum, but had to remember to set write permissions on my server.
<?php
$fileatt = date("d-m-Y-His") . ".pdf"; // Creates unique PDF name
copy('php://input',$fileatt); // Copies POST data to pdf file
?>
Make sure the PDF button is set to send data as "PDF" not "HTTP Post data"
The form will sent a blank PDF back to the user... But you can send whatever response you want by doing
header('Location: your_return_form.pdf');
(or re-direct to another webpage, or whatever)
Still has some kinks, but works for the most part I think.
这篇关于PDF表格提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!