NYCPHP Meetup

NYPHP.org

[nycphp-talk] Can't get no $action

John Lacey jlacey at att.net
Mon Apr 26 11:03:58 EDT 2004



Adam Maccabee Trachtenberg wrote:
> On Mon, 26 Apr 2004, Jeff Siegel wrote:
> 
> 
>>Some of these books have great ideas but make life quite confusing for
>>the newcomer. Some books use $HTTP_POST_VARS and others use $_POST in
>>their code. (See note 1 at
>>http://phundamentals.nyphp.org/PH_bookrecommendations.php). It depends
>>when they were written. And, as you found out, some assume
>>register_globals has been turned on.
> 
> 
> FWIW, "PHP Cookbook" assumes register_globals is Off and always
> superglobals like $_POST over the $HTTP_POST_VARS equivalent.

The other thing that causes unnecessary hiccups to newcomers is 
the mixed use of "echo" and "print".  It may be a small matter 
to experienced folks, but my rule of thumb on this would be "use 
echo in all cases -- use print only if the code calls for it".

Without getting into the "echo-is-slightly-faster-than-print" 
discussion, the word "echo" makes more sense to me in terms of 
"echoing to a screen/display/browser".

John




More information about the talk mailing list