trying insert a checkbox in a form of terms and condition
<p>I am trying to input a check-box for terms and conditions in a form, but when I registered the form without ticking the box the registration went through , (which was not suppose to be). Please help have a look.</p>

<pre><code>&lt;?php
echo "&lt;h2&gt;Register&lt;/h2&gt;";

$submit = $_POST['register'];
//form data
$fullname = mysql_real_escape_string(htmlentities(strip_tags($_POST['fullname'])));
$username = strtolower(mysql_real_escape_string(htmlentities(strip_tags($_POST['username']))));
$password = mysql_real_escape_string(htmlentities(strip_tags($_POST['password'])));
$repeatpassword = mysql_real_escape_string(htmlentities(strip_tags($_POST['repeatpassword'])));
$email = mysql_real_escape_string(htmlentities(strip_tags($_POST['email'])));
$houseno = mysql_real_escape_string(htmlentities(strip_tags($_POST['houseno'])));
$addressa = mysql_real_escape_string(htmlentities(strip_tags($_POST['addressa'])));
$addressb = mysql_real_escape_string(htmlentities(strip_tags($_POST['addressb'])));
$addressc = mysql_real_escape_string(htmlentities(strip_tags($_POST['addressc'])));
$county = mysql_real_escape_string(htmlentities(strip_tags($_POST['county'])));
$state = mysql_real_escape_string(htmlentities(strip_tags($_POST['state'])));
$country = mysql_real_escape_string(htmlentities(strip_tags($_POST['country'])));
$accept = mysql_real_escape_string(htmlentities(strip_tags($_POST['accept'])));

if ($submit)
{
$namecheck = mysql_query("SELECT username FROM reusers WHERE username='$username'");
$count = mysql_num_rows($namecheck);

if($count!=0)
{
die("Username already taken!");

}


//check for registration form details
    if ($fullname&amp;&amp;$username&amp;&amp;$password&amp;&amp;$repeatpassword&amp;&amp;$email&amp;&amp;$houseno&amp;&amp;$addressa&amp;&amp;$county&amp;&amp;$state&amp;&amp;$country)
{
if($accept!= 1)
{
if ($password==$repeatpassword)
{
//check char lenght of username and fullname
if (strlen($username)&gt;25||strlen($fullname)&gt;25)
{
echo "Lenght of username or fullname is too long";
}
else
{

//check password length

if(strlen($password)&gt;25||strlen($password)&lt;6)
{
echo"Password must be between 6 and 25 characters";
}
else
{
//check password length
$emailcheck = mysql_query("SELECT email FROM reusers WHERE email='$email'");
$ecount = mysql_num_rows($emailcheck);
if($ecount!=0)
{
echo"email already registered Please sign in into your account to continue";
}
else
    {
       //generate random code
       $code = rand(11111111,99999999);

   //send activation email
   $to = $email;
   $subject = "Activate your account";
   $headers = "From: donotreply@reacheasy.co.uk";
   $body = " Hello $fullname,\n\nUsername $username,\n\n Password $password ,\n\nYou registered `and need to activate your account. Click the link below or paste it into the URL bar of your browser\n\nhttp://reach.co.uk/activate.php?code=$code\n\nThanks!";

   if (!mail($to,$subject,$body,$headers))
       echo "We couldn't sign you up at this time. Please try again later.";

else

{

//register the user!
//encript password
$password = md5($password);
$repeatpassword = md5($repeatpassword);


$queryreg = mysql_query("

INSERT INTO reusers VALUES ('','$fullname','$username','$password','$email','$code','0','houseno','addressa','addressb','addressc','county','state','country')

");

die("You have been registered successfully! Please check your email ($email) to activate your account&lt;a href='index.php'&gt;Return to login page&lt;/a&gt;");
}
}
}
}
}
else
    echo"Your passwords do not match!";

}
else
    echo"Please read and accept Terms and Conditions before registering!";
}
else
        echo "Please fill in &lt;b&gt;all&lt;/&gt; fields!";

}
?&gt;
</code></pre>
