Cannot access ID's in URL ($_GET)

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
imroue
Forum Newbie
Posts: 6
Joined: Fri Oct 18, 2002 11:24 pm

Cannot access ID's in URL ($_GET)

Post by imroue »

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
:(
User avatar
qiangxd
Forum Newbie
Posts: 8
Joined: Thu Dec 05, 2002 6:00 pm

Post by qiangxd »

i don't understand your means
you can give a try

$HTTP_GET_VARS['id']
User avatar
mydimension
Moderator
Posts: 531
Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:

Post by mydimension »

nope, $_GET is correct, provided you are using php version >4.1.x

now, when you say forwarded, do you mean the actual address in the browser address bar changes or do you use that url redirection service that masks the original url (commonly used to direct to free hosting services with long urls)?
f1nutter
Forum Contributor
Posts: 125
Joined: Wed Jun 05, 2002 12:08 pm
Location: London

Post by f1nutter »

If you have control over the redirection, don't forget to append the query to the file at the new URL.
Post Reply