reading a variable

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
Vince
Forum Newbie
Posts: 4
Joined: Wed Mar 24, 2004 5:12 pm

reading a variable

Post by Vince »

Hi,

I am wanting to do something like this:

http://mydomain.com/?advertiser

This is going to be for an affilliate program I am designing. Each affilliate will have a different link.

I am wondering though, how would I use the ?advertiser part in my code?

Since the ?advertiser could be almost anything I can not use the regular old
$variable = $_POST['variable'];

Because I don't know the name of the variable.

I know there is a way to do this, I have seen it done before. I just can't find it on the forums or by searching google.

Any help would be appreciated.

Vince
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

if(!empty($_GET)){
echo key($_GET);
}

??
Vince
Forum Newbie
Posts: 4
Joined: Wed Mar 24, 2004 5:12 pm

thanks

Post by Vince »

Thank You, Thank You, Thank You.....

Ok this was bugging me all day. I was really trying to figure it out myself before posting. That's why I am so overjoyed to have it figured out!

Vince
Post Reply