- Joined
- Feb 27, 2003
- Messages
- 9,158
PHP variables aren't working for you? Read this.
Hello,
This is just a note to all php users, that by default, registerglobals is set to off. What this means is that if you have a php page, when you run:
page.php?name=gary
$name will *not* hold the value of gary in your script. What you need to do is use the $_GET array:
$_GET['name']
(or $_POST['name'] if you've passed it via POST)
This is something that php.net is pushing towards, as registerglobals=on can be a security risk if the scripts are programmed poorly.
If you *must* have it on, then contact your host and have him change the php.ini to turn it on.
John
Hello,
This is just a note to all php users, that by default, registerglobals is set to off. What this means is that if you have a php page, when you run:
page.php?name=gary
$name will *not* hold the value of gary in your script. What you need to do is use the $_GET array:
$_GET['name']
(or $_POST['name'] if you've passed it via POST)
This is something that php.net is pushing towards, as registerglobals=on can be a security risk if the scripts are programmed poorly.
If you *must* have it on, then contact your host and have him change the php.ini to turn it on.
John