Notice: Undefined variable driving me crazy...

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
Skeletor
New php-forum User
New php-forum User
Posts: 147
Joined: Tue Nov 19, 2002 7:47 am
Location: US, Ohio
Contact:

Post by Skeletor » Wed Feb 12, 2003 12:14 pm

you test if $add == "yes", but where does add get set? Seems like if it's an undefined variable, it is not getting set above the code you put into the msg.

perhaps make your if something like:

if(!empty($add) && $add == "yes") {

that will test to make sure it is set, is not empty and is equal to yes.

pootergeist
New php-forum User
New php-forum User
Posts: 191
Joined: Wed Jan 29, 2003 7:11 am
Location: UK
Contact:

Post by pootergeist » Thu Feb 13, 2003 2:24 am

if you have register_globals set to OFF (as you really should do) in your ini file, you will not be able to address passed variables except through their array collective.

if($_POST['add'] == "yes")

or

if($HTTP_POST_VARS['add'] == "yes")

one of those should do the trick.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests