Try the following. I think this is what you are actually looking for...

Code:
<?php
if(isset($_GET["username"])){
					if ($_GET["sex"]==1)
						echo $_GET["username"]." hi sir";
					elseif ($_GET["sex"]==2)
						echo $_GET["username"]." hi madam";
					else {
						echo "u haven't chosen ur gender <br>";
...