php - Make cURL behave like exactly like form -


I have a site that sends data to some remote site - Simple HTML form What I want to do is to use the data user To do statistical purposes is to enter the form. So instead of sending data to the remote page, I send it to my script for the first time which sends it to the remote site.

I need to behave correctly that the display of remote sites and resources for the user in general.

When I use this code it works a bit, but the way I want it, not in it:

  $ ch = curl_init () ; Curl_setopt ($ ch, CURLOPT_URL, $ verb); Curl_setopt ($ CH, CURLOPT_POST, 1); Curl_setopt ($ CH, CURLOPT_POSTFIELDS, $ fields); Curl_setopt ($ CH, CURLOPT_FOLLOWLOCATION, 1); $ Result = curl_xac ($ CH); Curl_close ($ ch);  

The problem is that it displays a response in a single script, for example if $ action is for example: somesite.com/processform.php and my script name is mysqcript.php It will display the response to "somesite.com/processform.php" inside "mysqcript.php" so that all related links are not working How do I send the user to "somesite.com/processform.php"? The only thing is that the button will press?

Leonti

There are several ways to do this. Here's one of the easiest: just use the 307 redirect.

  header ('location: http://realsite.com/form_url.php', true, 307 ');  

You can do your logging and stuff either before or after header () but if you type header After making a call, your script must start with

  unexpected_user_bort (true);  

Note that the browser should inform the user that their form is being redirected.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -