简体   繁体   English

重定向到单独的页面时如何验证表单?

[英]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.

相关问题 如何使用SQL数据库验证表单? - How can I verify a form with an SQL databse? 如何将HTML表单提交与JavaScript表单更新分开? - How can I separate my HTML form submit from my JavaScript form update? 页面从表单重定向到我的PHP脚本 - Page is redirecting to my php script from form 如何让我的注册表单页面与 php 一起使用? - How can i get my registration form page to work with php? 如何通过重定向到Codeigniter中的函数来获取Form中的数据和Flashmessage? - How Can I get the Data and Flashmessage in Form by redirecting to a function in Codeigniter? 当用户成功在我的网站上注册时,我想看到“将您重定向到登录页面”。 我怎样才能做到这一点? - I want to see “redirecting you to the login page” when a user successfully registers on my website. How can i do this? 如果验证失败,如何使用 ajax 和 php 以模态形式显示错误,如果成功则重定向到其他页面 - How to display error in modal form using ajax and php if validation fail while redirecting to other page if success 如何在我的代码中使用密码验证来更正错误 - How can I correct the error with password verify in my code 如何在不重定向到表单操作页面的情况下处理表单操作的结果? - How do I process the result of a form action without redirecting to that form action page? 重定向到同一页面时,表单验证错误未显示在 codeigniter 中 - form validation error is not displaying in codeigniter while redirecting to same page
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM