If I tick the checkbox everything is fine, it only errors with an unchecked checkbox on line
$merit = $_POST['merit'];
It's not recognising the 'merit' form value, sorry don't have the error message, if left unticked :(
Printable View
If I tick the checkbox everything is fine, it only errors with an unchecked checkbox on line
$merit = $_POST['merit'];
It's not recognising the 'merit' form value, sorry don't have the error message, if left unticked :(
HTML forms don't send the values of checkbox inputs that aren't checked. Try using isset() to make sure you have data before setting it:
Code:$merit = 0;
if(isset($_POST['merit'])){
$merit = $_POST['merit'];
}
//or...
$merit = (isset($_POST['merit'])) ? $_POST['merit'] : 0;
Thanks mate, works like a brought one :thumb: