[英]How can I verify my form while redirecting to a separate page?
So I'm creating a form that uses the values entered to create a PDF. 因此,我正在创建一个使用输入的值创建PDF的表单。 Now, the php that I'm using to do this is already completed from another person. 现在,我用于执行此操作的php已由另一个人完成。 Currently everything works great, except once you complete the form it redirects you to the site listed in action="..." 当前,一切正常,除非您填写完表格,它将您重定向到action =“ ...”中列出的网站。
<form action="http://www.otherdomain.com/action.php" method="post" name="application" target='_blank' onsubmit="return validateform(this);">
That is what the code looks like. 这就是代码的样子。 I would like to have the code redirect to my own 'success' page rather than the otherdomain.com success page, except I can't copy the PHP into my own page because I am using wordpress and there isn't a way to create a page with a .php ending, so the action needs to stay as-is. 我想将代码重定向到我自己的“成功”页面,而不是otherdomain.com成功页面,除了我无法将PHP复制到自己的页面中,因为我正在使用wordpress,并且无法创建方法一个以.php结尾的页面,因此操作需要保持原样。
Sorry if I'm seeming kind of vague, I don't know much about php or javascript and I'm having troubles putting my thoughts into words. 抱歉,如果我有点含糊,我对php或javascript不太了解,并且我很难将自己的想法转化为文字。
You should do this request within your server, using PHP extension named curl
to achieve this. 您应该在服务器内使用名为curl
PHP扩展来实现此请求。
Basically, from you own website, the script will make another request based on the one you sent with de form, get the response and then redirect to the disired page. 基本上,脚本将从您自己的网站发出另一个请求,该请求基于您以de form发送的请求,获取响应,然后重定向到所需页面。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.