$mode and $HTTP_GET_VARS['mode']

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
User avatar
Mr Tech
Forum Contributor
Posts: 424
Joined: Tue Aug 10, 2004 3:08 am

$mode and $HTTP_GET_VARS['mode']

Post by Mr Tech »

Let say that I link to a page like this: http://www.domain.com/page.php?mode=test

If I had this code on the page it would be displayed blank:

Code: Select all

<?php
echo $mode;
?>
If I had this on the page it would display "test":

Code: Select all

<?php
echo HTTP_GET_VARS['mode']
?>
What would I need to turn on to allow the first example ($mode) to work? I can't remember the term for this.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

extract()

By the way, its not HTTP_GET_VARS anymore, just $_GET['mode'].
User avatar
dethron
Forum Contributor
Posts: 370
Joined: Sat Apr 27, 2002 11:39 am
Location: Istanbul

Post by dethron »

global_variables = On
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

I'm sure having a thick day. But yea keep register globals Off at all costs.
Even the use of extract to mimic register globals, when used improperly can lead to some serious problem.

please read the documentation found at http://php.net/register_globals
User avatar
dethron
Forum Contributor
Posts: 370
Joined: Sat Apr 27, 2002 11:39 am
Location: Istanbul

Post by dethron »

The guy is asking for terminology, i am not :evil: :lol:
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

~dethron your avatar scares me a little can you change it please? :cry: :lol:
User avatar
dethron
Forum Contributor
Posts: 370
Joined: Sat Apr 27, 2002 11:39 am
Location: Istanbul

Post by dethron »

sorry dude, i am using this avatar in devnetwork for more than 2 years. I set it to this one when jason (lotito) changed my nick by my request :) thnx jason.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

heh... I was only messin' with you :P
Post Reply