Page 1 of 1

Query string from URL to a diff URL...

Posted: Mon Mar 15, 2004 11:16 pm
by Simon Angell
I want the php script to read the URL in the browser in this case http://www.my-domain.com/warnigrab.php?IDN36630.txt (the stuff after the ? will change depending on the txt file issued i have no probelm with this part of the script/s though.)

The script then needs to get the code after the ? and place it in a URL similar to.. $read = file_get_contents("http://www.another-domain.com.au/cgi-bi ... .pl?".$txt.); where $txt = the IDN value from http://www.my-domain.com/warnigrab.php?IDN36630.txt . I have tried using a few things, but none seem to work the way i planned, does anyone have a suggestions?

cheers
Simon

Posted: Mon Mar 15, 2004 11:22 pm
by Goowe
$_SERVER['QUERY_STRING'] will return IDN36630.txt

You could then do...

Code: Select all

<?php
$read = file_get_contents("http://www.another-domain.com.au/cgi-bin/wrap_fwo.pl?".$_SERVER['QUERY_STRING']);
?>

Posted: Mon Mar 15, 2004 11:34 pm
by Simon Angell
I did try this to begin with, but it didn't work. works great this time, Cheers!!!!

Simon

Posted: Mon Mar 15, 2004 11:40 pm
by Goowe
Sweet beans! If you need anything else just hollar :wink: