//【action="?" 提交到当前页面】,$_GET取值同理
<form action="?" method="post">
<input type="text" name="username"/>
<input type="password" name="pwd"/>
<input type="submit" name="sub"/>
</form>
<?php
if(!empty($_POST["username"])){
echo $_POST["username"];
}
if(!empty($_POST["pwd"])){
echo $_POST["pwd"];
}
?>