View Single Post
 
Old January 26th, 2004, 05:34 AM
richard.york's Avatar
richard.york richard.york is offline
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Hey Jaap,

No worries!
I should have pointed out that most of us, that is those of us that answer questions frequently, don't have the book. I just sold my copy a week or two ago... I've already learned the language and didn't much see the need to hang onto it.

The short answer is yes, it is more strict.

The Wrox book came out before certain adjustments in the language to tighten up security were made... the two having the most adverse effects being:

register_globals = off

AND

error_reporting = E_ALL

The Wrox book written before all this happened did not structure examples to accomodate either one.

When I first began learning the language I thought the adjustments were silly, but now having a little experience under my belt I can see that their benefits outweigh their nuisance greatly.

To me those being, both allow the creation of more easily understood code with regards to readability and logic flow. And the discovery of errors with E_ALL along the lines of non-initialized variables is in itself invaluable to bug tracking... this is particularly useful if you mispell a variable or array indice.. the program, most times, will catch that and point it out to you in the form of a NOTICE level error. In your case the NOTICE level error came in the form of an undefined constant.

Some extra reading as to why the adjustments were made:
http://www.php.net/manual/en/security.index.php

...which contains a wealth of information on PHP security in general.

The PHP manual is always helpful.. doesn't do much hand holding.. but you'll find it very useful as you learn the language.

http://www.php.net/manual

Cheers!
: )
Rich

:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::