a error with IF statement to check if checkbox is on

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Mythic Fr0st
Forum Contributor
Posts: 137
Joined: Sat Dec 02, 2006 3:23 am
Contact:

a error with IF statement to check if checkbox is on

Post 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;
}
gunman
Forum Newbie
Posts: 10
Joined: Fri Aug 26, 2005 12:07 pm

Post 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;
}
Mythic Fr0st
Forum Contributor
Posts: 137
Joined: Sat Dec 02, 2006 3:23 am
Contact:

ahhh

Post by Mythic Fr0st »

Thanks alot, - fixed XD
Post Reply