error! got undefined variable if sent empty post
<p>i got error message if sent empty post in my registration form</p>

<p><strong>Notice: Undefined index: terms in /opt/lampp/htdocs/user/register.php on line 34</strong></p>

<p>in the line 34 i have this </p>

<pre><code>$terms = trim($_POST["terms"]);
</code></pre>

<p>and in the form i have this</p>

<pre><code>&lt;p&gt;
&lt;input type="checkbox" name="terms" id="terms"&gt; I have read and accept the conditions of use
&lt;/p&gt;
</code></pre>

<p>and this is all the validation form</p>

<pre><code>if(!empty($_POST))
{
        $errors       = array();
        $terms        = trim($_POST["terms"]);
        $captcha      = md5($_POST["captcha"]);
    $name         = trim($_POST["name"]);

    if($terms == "")
    {
        $errors[] = lang("ACCOUNT_SPECIFY_NAME");
    }

    //End data validation
    if(count($errors) == 0)
    {   
            //Construct a user object
            $user = new User($username,$password,$email,$name,$lastname);

            //Checking this flag tells us whether there were any errors such as possible data duplication occured
            if(!$user-&gt;status)
            {
                if($user-&gt;username_taken) $errors[] = lang("ACCOUNT_USERNAME_IN_USE",array($username));
                if($user-&gt;email_taken)    $errors[] = lang("ACCOUNT_EMAIL_IN_USE",array($email));   
                if($user-&gt;email_blocked)  $errors[] = lang("ACCOUNT_EMAIL_BLOCKED");        
            }
            else
            {
                //Attempt to add the user to the database, carry out finishing  tasks like emailing the user (if required)
                if(!$user-&gt;userCakeAddUser())
                {
                    if($user-&gt;mail_failure) $errors[] = lang("MAIL_ERROR");
                    if($user-&gt;sql_failure)  $errors[] = lang("SQL_ERROR");
                }
            }
    }
}
</code></pre>

<p>?></p>

<p>why i got this alert message?</p>

<p>thanks</p>
