473,508 Members | 4,779 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1413
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

30
2178
by: Hallvard B Furuseth | last post by:
Now that the '-*- coding: <charset> -*-' feature has arrived, I'd like to see an addition: # -*- str7bit:True -*- After the source file has been converted to Unicode, cause a parse error if a...
27
2564
by: John Roth | last post by:
PEP 263 is marked finished in the PEP index, however I haven't seen the specified Phase 2 in the list of changes for 2.4 which is when I expected it. Did phase 2 get cancelled, or is it just not...
41
3042
by: Matt Alanzo | last post by:
Our SOHO 2 person compay sells furniture (not programmers). In '98 we paid $,$$$ for a VBA -Access '97 accounting application, including VBA source code .... an huge investment for us then (and...
8
2227
by: Alvo von Cossel I | last post by:
hey everybody, I have written a great browser but it is missing a feature (quite a lot actually, but forget about them for now). that feature just so happens to be the View > Source function....
9
3314
by: WRH | last post by:
Hello I am new to asp but I made some Jscript functions which work fine. The functions contain some strings used as a registration key for some apps. It is important that these strings not be...
135
7342
by: Xah Lee | last post by:
Tabs versus Spaces in Source Code Xah Lee, 2006-05-13 In coding a computer program, there's often the choices of tabs or spaces for code indentation. There is a large amount of confusion about...
31
8566
by: smachin1000 | last post by:
Hi All, Does anyone know of a tool that can automatically analyze C source to remove unused #includes? Thanks, Sean
11
2551
by: Chad | last post by:
Hi Is it possible to substitute an alternative data source (eg MySQL or SQL Server) into an existing MS-Access application?
0
1198
by: kellyonlyone | last post by:
E-XD++ MFC Library Enterprise Edition V11.0 is released (100% MFC/C++ Source Code)! ("The only Flow/Diagramming Kits that provides full source code of components for MFC and ActiveX in a single...
22
2354
by: Ken Foskey | last post by:
On Thu, 14 Aug 2008 10:09:01 -0700, raylopez99 wrote: The facts of the case above are that the person took a whole application and distributed it after some minor modifications, ie they did not...
0
7128
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7332
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7058
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5635
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1565
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
426
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.