Hi,

Basically I am writing quite a long script and have come to an abrupt halt on one small problem!

I want to use a URL which is called by a server when another URL is passed to it. So for example when I call a GET on say:
www.domain.com/page
the actual URL gotten is:
www.domain.com/otherpage

now i need to use that other URL in my script, so ideally i need something that does...

...a GET on a url passed in through a querystring...
....find out what the actual URL gotten was....
...output the URL to the page

so far i am completley stuck on this!

Please help!

    Hmm not quite sure what you want here. If the url was somepage.php?url=someotherpage.php

    if($content = file_get_contents($_SERVER['DOCUMENT_ROOT']."/".$_GET['url'])){
      echo $contents;
      echo $_GET['url'];
    }else{
      echo "File not found: ".$_GET['url'];
    }
    

    Sorry if I've misunderstood.

      Not quite, but thats helps:

      To give it context:

      When you GET a URL, often the page actually returned is different from the one requested. The actual URL is eventually shown in the address bar. I want a script which u can pass the original URL and it will return the acutal returned URL (not the content).

      Any ideas?

        Ah you mean if the 1st URL caused a redirect somehow to a 2nd URL. I'm not sure if you can get that, take a look in the $_SERVER array and see whats available.

          Write a Reply...