PHP Form select & radio error
<p>PHP Form select &amp; radio error
I have a form, but I got php error on select button and radio button
the error I got are $age and $gender</p>

<p>how to print error message in same page? </p>

<p>here is php code</p>

<pre><code>$firstname="";  $lastname="";   $email="";  $re_email="";

if(isset($_POST['register'])){
    $firstname=strip_tags($_POST['firstname']);
    $lastname=strip_tags($_POST['lastname']);
    $email=strip_tags(strtolower($_POST['email']));
    $re_email=strip_tags(strtolower($_POST['re_email']));
    $password=strip_tags($_POST['password']);
    $re_password=strip_tags($_POST['re_password']);
    $age=$_POST['age'];
    $gender=$_POST['gender'];
    $date=date("Y-m-d");

    if($firstname &amp;&amp; $lastname &amp;&amp; $email &amp;&amp; $re_email &amp;&amp; $password &amp;&amp; $re_password &amp;&amp; $age &amp;&amp; $gender){}
    else{die("Please fill in all fields");}

    //USERNAME CHECKING//////////////////////////////////////////////////////////////////
    $connect=mysql_connect("localhost", "root", "");
    $database=mysql_select_db("phplogin", $connect);
    $namecheck=mysql_query("SELECT email FROM users WHERE email='$email'");
    $count=mysql_num_rows($namecheck);
    if($count!=0)
    {die("Username already taken");}
</code></pre>

<p>here are Html code</p>

<pre><code>&lt;html&gt;
&lt;H1&gt;Register&lt;/H1&gt;
    &lt;form action="register.php" method="POST"&gt;
    &lt;table&gt;
        &lt;tr&gt;
            &lt;td&gt;First Name:&lt;/td&gt;
            &lt;td&gt;&lt;input type="text" name="firstname" value="&lt;?PHP echo $firstname;?&gt;" maxlength="25"/&gt;&lt;/td&gt;
            &lt;td&gt;Maxium 25 characters&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
            &lt;td&gt;Last Name:&lt;/td&gt;
            &lt;td&gt;&lt;input type="text" name="lastname" value="&lt;?PHP echo $lastname;?&gt;"maxlength="25"/&gt;&lt;/td&gt;
            &lt;td&gt;Maxium 25 characters&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
            &lt;td&gt;email:&lt;/td&gt;
            &lt;td&gt;&lt;input type="text" name="email" value="&lt;?PHP echo $email;?&gt;"maxlength="40"/&gt;&lt;/td&gt;
            &lt;td&gt;Maxium 40 characters&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
            &lt;td&gt;Re-enter email:&lt;/td&gt;
            &lt;td&gt;&lt;input type="text" name="re_email" value="&lt;?PHP echo $re_email;?&gt;"maxlength="40"/&gt;&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
            &lt;td&gt;Password:&lt;/td&gt;
            &lt;td&gt;&lt;input type="password" name="password" maxlength="25"/&gt;&lt;/td&gt;
            &lt;td&gt;Password must be between 6 and 25 characters&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
            &lt;td&gt;Re-eneter Password:&lt;/td&gt;
            &lt;td&gt;&lt;input type="password" name="re_password" maxlength="50"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/table&gt;
    &lt;select&gt;
            &lt;option value=""&gt;Age&lt;/option&gt;
            &lt;option name="age" value="18-29"&gt;18-29&lt;/option&gt;
            &lt;option name="age" value="30-39"&gt;30-39&lt;/option&gt;
            &lt;option name="age" value="40-49"&gt;40-49&lt;/option&gt;
            &lt;option name="age" value="50-59"&gt;50-59&lt;/option&gt;
            &lt;option name="age" value="60-69"&gt;60-69&lt;/option&gt;
            &lt;option name="age" value="70"&gt;70 Plus&lt;/option&gt;
        &lt;/select&gt;
        &lt;input type="radio" name="gender" value="male" /&gt;Male
        &lt;input type="radio" name="gender" value="female" /&gt;Female
    &lt;input type="submit" name="register" value="Register" /&gt;
    &lt;/form&gt;
&lt;/html&gt;
</code></pre>
