Good Morning .... I am sorry if this is a repeat question or if it is so simple to some. I searched the usergroup but i could not find the answer.
--My register_globals are turned off.
--I am using PHP4.3
--Page index.php is calling itself and passing a URI parameter in the url string (http://www.abcd.com/index.php?testSTR=aboutus).
--All i am trying to do is get the value of the testSTR. I tried all superglobal value with no use. I read Jason's article but it still does not work for this one.
Any help is greatly appreciated.
When i display the the following, it all displays blanks...
echo $HTTP_SERVER_VARS['iam']
echo $HTTP_SERVER_VARS['$iam'];
echo $HTTP_SERVER_VARS[$iam];
echo $_SERVER['iam'];
echo $_SERVER['$iam'];
echo $_SERVER[$iam];
echo $_POST['iam'];
echo $_POST['$iam'];
echo $_POST[$iam];
Is there anything el;se that has to be turned on with PHP4.3???
thanks again
Super Globals... Why returnung blank in all ...
Moderator: General Moderators
-
PingLeeQuan
- Forum Commoner
- Posts: 58
- Joined: Tue Sep 03, 2002 8:08 am
-
PingLeeQuan
- Forum Commoner
- Posts: 58
- Joined: Tue Sep 03, 2002 8:08 am
OK... I turned register_globals on and it seems to be working. My quesation remains, why is it that we have to turn on register globals if we are supposed to accomplish teh same thing by using the $_POST, $_GET, $_SERVER,..... that came to replace the register globals?!
Isn't it a security issue that register_globals are turned off?
Again, sorry for the simplicity of this question.
--quan
Isn't it a security issue that register_globals are turned off?
Again, sorry for the simplicity of this question.
--quan
- Bill H
- DevNet Resident
- Posts: 1136
- Joined: Sat Jun 01, 2002 10:16 am
- Location: San Diego CA
- Contact:
It's in the $_GET array, as in
You will also fond it in $_REQUEST
Code: Select all
<?php
if ($_GET['testSTR'] = whatever)
{ // whatever
}
?>
Last edited by Bill H on Tue Dec 31, 2002 8:45 am, edited 1 time in total.
Read this, it will explain all, or it will try to at least.
http://www.php.net/manual/en/language.v ... efined.php
Have a good new year.
http://www.php.net/manual/en/language.v ... efined.php
Have a good new year.
Did your echo examples mean to refer to "testSTR" instead of "iam" for the variable name? "iam" certainly will not be set if the URI refers to "testSTR". Try:
When you pass parameters using the "URL?var=value" syntax, this uses the "get" method so the parameters will be stored in the $_GET array.
Code: Select all
echo $_GETї'testSTR']-
PingLeeQuan
- Forum Commoner
- Posts: 58
- Joined: Tue Sep 03, 2002 8:08 am