How can I obtain a relative link when using the following function

From: tim koster (tim.koster_at_gmx.net)
Date: 11/28/03


Date: 27 Nov 2003 23:41:00 -0800

hi,

i am using the code below, to fetch information from another webpage
(e.g. www.testpage.com). i fetch the text from the word "begin_text"
zu the word "end_text".

I would like to fetch complete links instead of relative links. at the
moment the fetched link looks like this "../smile.gif". insted of
 this i would like to retreive the original "full" link
("http://www.testpage.com/smile.gif"). is this
possibloe in php?

tim

function string_zerlegen ($gesamt, $startstring, $endstring)
{
$zwischen=explode ($startstring, $gesamt);
$ergebnis=explode ($endstring, $zwischen[1]);
return $ergebnis[0];
}
{
$url="http://www.testpage.com";
$starttext="begin_text";
$endtext="end_text";
$seite= implode ('', file ($url));
echo string_zerlegen ($seite, $starttext, $endtext);
}



Relevant Pages

  • How can I obtain a relative link when using
    ... i am using the code below, to fetch information from another webpage ... echo string_zerlegen ($seite, $starttext, $endtext); ...
    (php.general)
  • Inject javascript in an HTML page ?
    ... I am looking for the proper way to fetch a webpage, inject javascript and run an IE component on it. ... I've been looking around with no luck. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: multiple webpages sharing a dataset reference
    ... >>I m wondering how to fetch a dataset and hold it in the memory for used ... >>pressing the Query button in a Query webpage. ... Here I have a general question about perl. ...
    (comp.lang.perl.misc)
  • Re: multiple webpages sharing a dataset reference
    ... >>I m wondering how to fetch a dataset and hold it in the memory for used ... Assumed the perl code above is being executed by ... >>pressing the Query button in a Query webpage. ...
    (comp.lang.perl.misc)
  • Re: multiple webpages sharing a dataset reference
    ... > I m wondering how to fetch a dataset and hold it in the memory for used ... > pressing the Query button in a Query webpage. ... The Query webpage has a form that submits to some_script.cgi. ... How you transport information to this ...
    (comp.lang.perl.misc)