globals

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
learning_php_mysql
Forum Commoner
Posts: 27
Joined: Sun Aug 04, 2002 12:58 pm
Location: WA

globals

Post by learning_php_mysql »

uhh i need some help... i want to pass variables through urls then have a switch statement that includes files depending on the 'page id' but what's the global for getting variables out of the address bar?
is it like $HTTP_POST_VARS[""] or $HTTP_COOKIES_VARS[""] ?

thanks
User avatar
protokol
Forum Contributor
Posts: 353
Joined: Fri Jun 21, 2002 7:00 pm
Location: Cleveland, OH
Contact:

Post by protokol »

$HTTP_GET_VARS[]
learning_php_mysql
Forum Commoner
Posts: 27
Joined: Sun Aug 04, 2002 12:58 pm
Location: WA

Post by learning_php_mysql »

cool, thanks a ton
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

$_GET, if you're using PHP 4.1 or above.

Here's the rest of them: http://www.php.net/manual/en/language.v ... efined.php

Mac
User avatar
protokol
Forum Contributor
Posts: 353
Joined: Fri Jun 21, 2002 7:00 pm
Location: Cleveland, OH
Contact:

Post by protokol »

using $HTTP_*_VARS will work with any version of PHP though
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

they are being deprecated though, due to the fact they take a while to type and the fact that they are not autoglobals
learning_php_mysql
Forum Commoner
Posts: 27
Joined: Sun Aug 04, 2002 12:58 pm
Location: WA

Post by learning_php_mysql »

twigletmac wrote:$_GET, if you're using PHP 4.1 or above.

Here's the rest of them: http://www.php.net/manual/en/language.v ... efined.php

Mac
thanks this is a really usefull page
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

protokol wrote:using $HTTP_*_VARS will work with any version of PHP though
Which isn't important if you're coding just for yourself and using PHP 4.1 or greater - and make sure you've got a host with the same. If you're writing scripts to share it's definitely an issue you should think about.

Mac
Post Reply