470,867 Members | 1,807 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,867 developers. It's quick & easy.

Source code Bug or Feature?

I have just inherited someone elses PHP code and there is something strange
in it, at least to me. I'm wondering if I inherited a source code bug or is
it a PHP feature that I don't know about. This code is in "index.htm" and
the first few lines of the file look like:

<?
if($parm) {
more code
}
?>

Now, the error I am getting is that "$parm" is not defined. I would expect
that. Or is there some "hidden" way $parm can be defined and I just haven't
found the code that does it, or don't how to do it.

Thanks...
Oct 18 '05 #1
5 1338
On Tue, 18 Oct 2005 14:53:08 -0400, "Bruce A. Julseth"
<br***********@attglobal.net> wrote:
I have just inherited someone elses PHP code and there is something strange
in it, at least to me. I'm wondering if I inherited a source code bug or is
it a PHP feature that I don't know about. This code is in "index.htm" and
the first few lines of the file look like:

<?
if($parm) {
more code
}
?>

Now, the error I am getting is that "$parm" is not defined. I would expect
that. Or is there some "hidden" way $parm can be defined and I just haven't
found the code that does it, or don't how to do it.


Search for "register_globals", then correct the script to use $_GET or $_POST
and never think about register_globals being on again :-)
--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Oct 18 '05 #2
Andy Hassall wrote:
<?
if($parm) {
more code
}
?>


Search for "register_globals", then correct the script to use $_GET or $_POST
and never think about register_globals being on again :-)


And use long opening tags: <?php
or you'll get in trouble with different configs or x(ht)ml docs.

--
E. Dronkert
Oct 18 '05 #3

"Andy Hassall" <an**@andyh.co.uk> wrote in message
news:ac********************************@4ax.com...
On Tue, 18 Oct 2005 14:53:08 -0400, "Bruce A. Julseth"
<br***********@attglobal.net> wrote:
I have just inherited someone elses PHP code and there is something
strange
in it, at least to me. I'm wondering if I inherited a source code bug or
is
it a PHP feature that I don't know about. This code is in "index.htm" and
the first few lines of the file look like:

<?
if($parm) {
more code
}
?>

Now, the error I am getting is that "$parm" is not defined. I would expect
that. Or is there some "hidden" way $parm can be defined and I just
haven't
found the code that does it, or don't how to do it.


Search for "register_globals", then correct the script to use $_GET or
$_POST
and never think about register_globals being on again :-)
--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool


RE: register_globals. I assume if I don't find any "register_globals"
defined, this is a bug in the code. Right?

Thanks...
Oct 19 '05 #4

"Ewoud Dronkert" <fi*******@lastname.net.invalid> wrote in message
news:0m********************************@4ax.com...
Andy Hassall wrote:
<?
if($parm) {
more code
}
?>


Search for "register_globals", then correct the script to use $_GET or
$_POST
and never think about register_globals being on again :-)


And use long opening tags: <?php
or you'll get in trouble with different configs or x(ht)ml docs.

--
E. Dronkert


Thanks for the tip.

Bruce
Oct 19 '05 #5
Bruce A. Julseth (br***********@attglobal.net) wrote:

: "Andy Hassall" <an**@andyh.co.uk> wrote in message
: news:ac********************************@4ax.com...
: > On Tue, 18 Oct 2005 14:53:08 -0400, "Bruce A. Julseth"
: > <br***********@attglobal.net> wrote:
: >
: >>I have just inherited someone elses PHP code and there is something
: >>strange
: >>in it, at least to me. I'm wondering if I inherited a source code bug or
: >>is
: >>it a PHP feature that I don't know about. This code is in "index.htm" and
: >>the first few lines of the file look like:
: >>
: >><?
: >>if($parm) {
: >> more code
: >>}
: >>?>
: >>
: >>Now, the error I am getting is that "$parm" is not defined. I would expect
: >>that. Or is there some "hidden" way $parm can be defined and I just
: >>haven't
: >>found the code that does it, or don't how to do it.
: >
: > Search for "register_globals", then correct the script to use $_GET or
: > $_POST
: > and never think about register_globals being on again :-)
: > --
: > Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
: > http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

: RE: register_globals. I assume if I don't find any "register_globals"
: defined, this is a bug in the code. Right?

It's a config setting in php.ini which is used by the server to control
how php works.

google: register_globals php_

Various entries, 'fraid you'll need to read a few to learn everything you
want to know.

--

This programmer available for rent.
Oct 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

30 posts views Thread by Hallvard B Furuseth | last post: by
27 posts views Thread by John Roth | last post: by
8 posts views Thread by Alvo von Cossel I | last post: by
135 posts views Thread by Xah Lee | last post: by
31 posts views Thread by smachin1000 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.