On 30 Jul 2004 21:58:49 -0400, steve <Us************@dbForumz.com>
wrote:
"Lost arcade" wrote: I am using PHP 4.3.4 and found something strange with a variable
name. When I try to use "$company" variable (lowercase), I get odd
behavior from that variable. The name of my php file is "company.php" but
I didn’t think that php associated them together. The behavior is
that
"$company" will take on values of the previously accessed $_GET
variable. I fixed it by using "$company_info" variable instead
but I would really like to know why the "$company" variable seems to be
a landmine.
The code includes the core Pear libraries and the pear IT library
but nothing else. I thought that system variables took the form of
"$_VAR"?
If anyone has run into odd behavior like this before let me know so
I can
find out what variables to avoid in the future.
Sam
Sam, that behavior is due to register_globas being ON. This is not a
good thing. You would want register globals off. It "should" be
OFF by default in your version of php.
http://www.desilva.biz/apache/regblsoff.html
Heh. WAAAAY back in a previous version somewhere, it must have been on
by default? I've not used the same variable name as a $_GET or $_POST
variable because I thought I had to. Not that it hurts to use
slightly different names.
(I usually use:
$VariableName = $_POST['variable_name'];
)
--
gburnore@databasix dot com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
DataBasix | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ 3 4 1 4 2 ݳ޳ 6 9 0 6 9 ÝÛ³
Black Helicopter Repair Svcs Division | Official Proof of Purchase
================================================== =========================
Want one? GET one!
http://signup.databasix.com
================================================== =========================