|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Right now I have a form that redirects to another site, not under our control. I do some simple processing in JavaScript using the onsubmit action to a function before they go to the other site.
But I want to use PHP to process the form a bit on my site then invisibly send the user to the other site with all the $_POST values so they can handle his request. Or in other words, I want it to look like a regular old form action. How to I wrap up the $_POST variables so when I header("Location: ...") the user over to the other site, they can get the POST data? |
|
#2
|
|||
|
|||
|
there isn't really a great option here. you could either check to see if the site can use get values as well as post and pass the form in the url. many sites have register globals on. other than that you could try to use curl to submit the form, and show the results, however that doesn't actually send them to the alternate site. another option would be to use javascript on submit of the form to do whatever logic/changes you want or perhaps even using ajax, send the form data to another page, get the response, replace their values with the response values and then use js to submit the form. you could also just have it submit to your page, do your stuff and show a message saying "you are being redirected" then on that page make a new form with hidden fields and the modified form results and use javascript to submit the form.
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > forms - Form Simulation in PHP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|