PHP radio button - undefined index
<p>Simple question, when I didn't select any radio button, I got error message
Undefined index: gender</p>

<pre><code>&lt;?PHP
if(isset($_POST['register'])){

    $gender=$_POST['gender'];
    echo $gender;
    }
?&gt;

&lt;html&gt;
    &lt;form action="testing.php" method="POST"&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>
