Query string from URL to a diff URL...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Simon Angell
Forum Commoner
Posts: 45
Joined: Fri Jan 24, 2003 12:14 am

Query string from URL to a diff URL...

Post 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
Goowe
Forum Commoner
Posts: 94
Joined: Mon Mar 15, 2004 9:51 am
Location: Southeast Alaska

Post 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']);
?>
Simon Angell
Forum Commoner
Posts: 45
Joined: Fri Jan 24, 2003 12:14 am

Post by Simon Angell »

I did try this to begin with, but it didn't work. works great this time, Cheers!!!!

Simon
Goowe
Forum Commoner
Posts: 94
Joined: Mon Mar 15, 2004 9:51 am
Location: Southeast Alaska

Post by Goowe »

Sweet beans! If you need anything else just hollar :wink:
Post Reply