<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Forms!</title>
</head>
<body>
<? if(!$_POST['submit']){ ?>
<form action="<?=$SERVER['php_self']?>" method="post">
<p><label for="email">Email </label><input name="email" type="text" placeholder="Enter your email"></p>
<button type="submit" name="submit" value="submit">Submit</button>
</form>
<?
}else{
//Submit button has been clicked
echo var_dump($_POST);
}
?>
</body>
</html>