View Single Post
  #3 (permalink)  
Old December 17th, 2004, 02:01 PM
peg110 peg110 is offline
Authorized User
 
Join Date: Dec 2004
Location: Tunkhannock, PA, USA.
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to peg110
Default

PHP essentially defines variables on the fly. Basically, as you assign a value to the variable, it defines it first and then assignes the value.

If no value is assinged to the variable, it does not get defined, thus an error.
As kuehhc points out if you use the SUPER GLOBAL of $_GET you will likely avoid the error (unless you submit with an EMPTY value in the field.) This is likely because in your PHP.INI file your register_globals is probably set to OFF. (This is a Safer method, but harder on the coding).

If you don't want to use the SUPER GLOBALS, then you can set the register_globals to ON and keep your original code.

To avoid this error when submitting an EMPTY value you could read http://p2p.wrox.com/topic.asp?TOPIC_ID=23664 which should help.

Good Luck

Paul Gardner
------------------
PHP-LIVE help
Via Web @ http://www.mnetweb.co.uk/irc
Via IRC Client pgardner.net:6667
room #PHP
Reply With Quote