简体   繁体   中英

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. Now, the php that I'm using to do this is already completed from another person. Currently everything works great, except once you complete the form it redirects you to the site listed in 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.

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.

You should do this request within your server, using PHP extension named curl to achieve this.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM