Page 1 of 1

a error with IF statement to check if checkbox is on

Posted: Mon Dec 04, 2006 2:16 am
by Mythic Fr0st
Im getting an error for my checkbox thing this is it:

Notice: Use of undefined constant on - assumed 'on' in c:\program files\easyphp1-8\www\mythic aeons\mailed.php on line 95

this is the code

Code: Select all

if (isset($_POST['t&c']) && $_POST['t&c'] == on)
{

}
else
{
echo '<font color="blue" size="4">Error:</font><font color="blue" size="3"><i> Please check the terms & conditions box.<br/></i></font>';
$bool[9]=false;
}

Posted: Mon Dec 04, 2006 2:30 am
by gunman
You should put on in quote

Code: Select all

if (isset($_POST['t&c']) && $_POST['t&c'] == "on")
{

}
else
{
echo '<font color="blue" size="4">Error:</font><font color="blue" size="3"><i> Please check the terms & conditions box.<br/></i></font>';
$bool[9]=false;
}

ahhh

Posted: Mon Dec 04, 2006 2:42 am
by Mythic Fr0st
Thanks alot, - fixed XD