cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

RE: redirect troubles...

From: <vah330_at_excite.com>
Date: Wed, 21 Jan 2004 17:17:02 -0500 (EST)

** Any ideas on how to do a physical redirect within cURL? **

You can't. cURL is used to send a request to a server *and retrieve the data returned*.

You could parse the data returned by your cURL function to add the Paypal URL to the relative <a href... and <img src... tags. Then display that page to the users.

Alternately you could use JavaScript to initiate a POST process from the calling page so the user ends up at the PayPal site.

Why is it you can't have (or don't want) the parameters in the page URL?

Dan O.

--Previous --

From: "Ace Mc Kool" <motorpsychkill_at_hotmail.com>

To: curl-and-php_at_lists.sourceforge.net

Subject: redirect troubles...

Date: Tue, 20 Jan 2004 18:35:47 +0000

Reply-To: curl-and-php_at_lists.sourceforge.net

Hello,

I'm trying to redirect my customers to the actual Paypal page (where the URL in the browser reflects the Paypal page) rather than just executing my cURL function (where the browser URL shows my domain, not Paypal's).

For e.g., this is what I want to happen (but without the GET parameters visible in the URL:

http://www.liquidphire.com/test.php?mode=header

This is what I have this so far (see actual code below):

http://www.liquidphire.com/test.php?mode=curl

You will notice that I get the Paypal page but all the image links are broken (because Paypal uses relative URL's in it's HTML).

<code>

     $ch = curl_init();

     curl_setopt($ch, CURLOPT_URL,"$url");

     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

     curl_setopt($ch, CURLOPT_POST, 1);

     curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER["HTTP_USER_AGENT"]);

     curl_setopt($ch, CURLOPT_REFERRER, "$from");

     curl_setopt($ch, CURLOPT_POSTFIELDS, "$string1");

     curl_setopt($ch, CURLOPT_VERBOSE, 0);

     curl_setopt($ch, CURLOPT_HEADER, 0);

     $data = curl_exec ($ch);

     curl_close ($ch);

     echo $data;

</code>

Any ideas on how to do a physical redirect within cURL? Thank you very much for any help!

-m

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
Received on 2004-01-21