php text box variables
I dont understand why this happens, I followed multiple tutorials and still
this error happens

How do I get the variable to work
this error happens

Code:
<?php
if(isset($_GET['ex']))
{
$ex = $_GET['ex'];
}
?>
<form action="" method="POST">
text: <input type="text" name="ex">
<input type="submit" name="submit" value="submit">
</form>
<?php
echo $ex
?>