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

curl-and-php

Re: how to get the last fetched URL

From: Natasha Trovaldo <scriptsbible_at_gmail.com>
Date: Wed, 5 Sep 2007 20:58:59 +0300

yes the result page displays the redirected page which url i want to fetch..

@Daniel: dont you think you are sounding very rude? i should not post on it
then why dont you close this drama and write in bold fonts that you will
help only for money and not for free. if i wont ask curl questions here then
where will i post? why have you made this mailing list drama? i am very
upset with your last email and am definitely going to discuss your behavior
in the next zend php conference.

On 9/5/07, Broekhuis,Robert R. <BROEKHRR_at_airproducts.com> wrote:
>
> Does the returned result page correspond to the redirected URL?
>
> ------------------------------
> *From:* curl-and-php-bounces_at_cool.haxx.se [mailto:
> curl-and-php-bounces_at_cool.haxx.se] *On Behalf Of *Natasha Trovaldo
> *Sent:* Wednesday, September 05, 2007 5:45 AM
> *To:* curl-and-php_at_cool.haxx.se
> *Subject:* Re: how to get the last fetched URL
>
>
> Hi
>
> I am trying this code finally
> //////////////////////////////////////
> $ch = curl_init();
> curl_setopt($ch, CURLOPT_URL,$url);
> curl_setopt($ch, CURLOPT_USERAGENT, $agent);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
> curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
> curl_setopt($ch, CURLOPT_REFERER, $reffer);
> curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
> curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
> $urll = curl_getinfo($ch,CURLINFO_EFFECTIVE_URL);
> $result = curl_exec ($ch);
>
> echo $result;
>
> curl_close ($ch);
>
> echo "URL: $urll";
>
> ============================
>
> now there is one problem, the url it shows as the last fetched url is in
> fact the local site url which i call from cURL which is like
>
> domain.com?siteid=integerid <http://domain.com/?siteid=integerid>
>
> this url is not my target because this redirects to the real site i want
> that url to which it redirects e.g when you browse a url like
>
> domain.com?siteid=integerid <http://domain.com/?siteid=integerid>
>
> it will redirect to another site.. i am using this url in my cURL session
> and trying to find the recent URL but my code is returning this
> domain.com?siteid=integerid <http://domain.com/?siteid=integerid>
>
> can anyone help please?
>
> Natasha,
> Free PHP Scripts Directory
> www.scriptsbible.com
>
> On 9/5/07, Natasha Trovaldo <scriptsbible_at_gmail.com> wrote:
> >
> > Hi
> >
> > I am trying to get only the last fetched URL by cURL session. I tried to
> > use curl_easy_getinfo() like this,
> >
> > $url = NULL;
> > curl_easy_getinfo($ch, CURLINFO_EFFECTIVE_URL, $url);
> > echo $url;
> >
> > but I get this error
> >
> > Fatal Error: Call to undefined function: curl_easy_getinfo()
> >
> > I have php 4.4.4 and cURL version 7.15.3
> >
> > I also tried Daniel this code,
> >
> > char *url = NULL;
> > curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &url);
> >
> > but then i get error that '=' sign required at line # 1
> >
> > Can anybody guide me please how to get the last fetched URL from a cURL
> > session?
> >
> > thank you
> >
> > Natasha,
> > Free PHP Scripts Directory And Resource Repository
> > www.scriptsbible.com
> >
>
>
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>
>

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2007-09-05