Im trying to make form and I want if the field is empty it doesnt show it at all, but it shows anyway.

<form action="form.php" method="get">
<fieldset style="width: 250px;">
<legend>Register Form</legend>

<!-- name, surname, email, password -->
<label>First name: <input type="text" name="firstname"></label><br>
<label>Last name: <input type="text" name="lastname"></label><br>
<label>E-mail: <input type="text" name="email" size="24"></label><br>
<label>Password: <input type="password" name="password"></label><br>

<!-- gender -->
<label for="gender">Gender:
<input type="radio" name="gender" value="M" /> Male
<input type="radio" name="gender" value="F" /> Female</p>
</label>

<!-- drop down menu -->
<label>Age:
<select name="age">
<option value="0-29">Under 30</option>
<option value="30-60">Between 30 and 60</option>
<option value="60+">Over 60 </option>
</select>
</label><br>

<!-- comment -->
<label>Comments: <textarea name="comments" rows="3" cols="40"></textarea>

</fieldset>
<!-- submit button -->
<input type="submit" value="Submit" name="submit">

</form>


and

<?php

$firstname = $_REQUEST['firstname'];
$lastname = $_REQUEST['lastname'];
$email = $_REQUEST['email'];
$password = $_REQUEST['password'];
$gender = $_REQUEST['gender'];
$age = $_REQUEST['age'];

if (isset($_REQUEST['firstname']))
echo 'Firstname is: ' . $firstname;
if (isset($_REQUEST['lastname']))
echo '<br>Lastname is: ' . $lastname;
echo '<br>Email is: ' . $email;
echo '<br>Password is: ' . $password;
echo '<br>Gender is: ' . $gender;
echo '<br>Age is: ' . $age;

Why it shows lines under if? And when I use chrome it shows me Notice: Undefined index: gender in C:\xampp\htdocs\form.php on line 7. but there is nothing wrong. :/