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

curl-and-php

Re: Host to Target Redirection (Transfer)

From: Stephen Pynenburg <spynenburg_at_gmail.com>
Date: Mon, 28 Apr 2008 17:50:33 -0400

If I read that right, all you want to do is change relative links to
absolute HTTP links - if so, then you're overthinking it.
Just use a str/preg_replace, like so:

str_replace(array("/private/news","/private/search"), array("
http://server/private/news","http://server/private/search"), $result);

-Stephen

On Sun, Apr 27, 2008 at 5:06 PM, David Colter <dolan2go_at_yahoo.com> wrote:

> Hello all,
>
> I'm wondering how to go to a page on my 'target' site
> after I've logged in & displayed that page with curl
> on my host site. (and transfer from my host to target
> host)
>
> For example, I've created a shortcut to a page
> (auto-login of sorts) on a website I use often. It is
> user specific, and session id's have been transfered
> during the curl phase of the php script. At the bottom
> of the page, after the curl received data echoing, I
> placed a submit button to process a 2nd script to pass
> those sessions id's (with curl) and bring up the users
> page. It all appears to work, a portion of the user
> specific page is displayed, with links that are
> '/private/news' or '/private/search' in the source.
> Also, the verbose output server response is 202. So it
> must like what's being sent.
>
> Clicking on one of them returns: "The requested URL
> /private/news/ was not found on this server." Doh!!
> That page is not on my server. Of course.
>
> I tried having the action of the submit button be the
> target page, but evidently no cookie info is
> transfered, and the login page is returned. I've also
> tried many time to use header() with all sorts of
> entries.
>
> So, is this transfer of servers possible with curl?
> Where should I be looking? All suggestions are
> welcome. Hope this wasn't too confusing.
>
> Thanks,
> David Colter
>
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2008-04-28