PDA

View Full Version : Cannot access ID's in URL ($_GET)


imroue
12-07-2002, 03:54 AM
for example:
http://www.mysite.com/index.php?id=3241

I want to access the "id".

so I do this:


$idIn = $_GET['id'];
echo "$idIn";


BUT since "www.mysite.com" is actually a forwarded URL.
Basically (for example)
http://www.mysite.com
is forwarded to:
http://123.123.123.123

I do not get the ID. It returns Undefined index: id

--Global Variables = ON in my php.ini

ANY IDEAS
:(

firepages
12-07-2002, 07:32 AM
how and where does the redirection take place ?

Dylan Leblanc
12-08-2002, 12:34 AM
This will forward to another domain while retaining the query string at the end of the URL. You will have access to $_GET['id'] at the new domain.


<?

header('Location: http://123.123.123.123/?' . $_SERVER['QUERY_STRING']);

?>