php cURL , POST and redirect client , proxy/bridge -


I am trying to create a php curl script which should act as a bridge / proxy (like "between Man "but nothing is hacking), post a URL (example.com) and after receiving that response, redirect the client to that link. I'm not sure if this is possible please advise. Basically the customer will pass 2 values ​​through our site (for example examplecurl.com) and after the value is passed, the client should be redirected to that specific site (example.com) as if it were through examples From the values ​​directly crossed. . I need to mention that the "example.com" site does not use cookies and I can successfully pass values ​​through curl script, I set the follow_location option, but only problem redirection is.

Thanks in advance for your help! Any solution would be appreciated!

I assume that you are typing it in PHP on the tag):

< Pre> $ ch = curl_init (); Curl_setopt ($ ch, CURLOPT_URL, 'http://www.example.com'); Curl_setopt ($ ch, CURLOPT_POSTFIELDS, "a = halo and amp; b = world"); Curl_setopt ($ CH, CURLOPT_POST, 1); Curl_setopt ($ CH, CURLOPT_RETURNTRANSFER, 1); $ Page = curl_exec ($ ch); Curl_close ($ ch);

Similarly, you request a post with a command with example.com . Without a cookie, a website can not be not so you must specify a cookie jar as such:

  curl_setopt ($ ch , CURLOPT_COOKIEJAR, "my_cookies text"); Curl_setopt ($ CH, CURLOPT_COOKIEFILE, "my_cookies.txt");  

Now, all the requests you make to curl by using the session (through curl) you have created so far are 'code' curl_close () < / Code>.

Your question was a bit confusing, I hope I answered.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -