Undefined index error

3 posts by 2 authors in: Forums > CMS Builder
Last Post: March 25, 2012   (RSS)

By nmsinc - March 24, 2012

I'm adding addtional code to the user-signup.php file for addtional fields that we have added to the 'accounts' section. Most of the these are check boxes. I have the input values set to "1" with the box "checked". When a user unchecks any box I get a undefined index error for that field upon submit. I do not want to turn-off error checking so I tried adding the isset code below to capture and set the vaule of unchecked box to 0 (zero) as the pass through without any luck. This code is located just above the mysql_query("INSERT INTO `{$TABLE_PREFIX}accounts` SET


// Check for null in checkboxes
if (!isset($_POST['view_map']))
{
$_POST['view_map'] = "0";
}

Suggestions anyone? - Thanks nmsinc
nmsinc

Re: [Dave] Undefined index error

By nmsinc - March 25, 2012

The hidden fields worked perfect - thanks Dave!
nmsinc