Notice: Undefined variable driving me crazy...

Ask about general coding issues or problems here.

Moderators: egami, macek, 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:

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:

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.
avatar image based upon nasas apod (only updates if I post though)

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 9 guests