Ajax 隐藏帧
lofin.html
<form action="post.php" method="post" target="myframe">
用户名: <input type="text" name="username">
密码: <input type="submit" value="登录">
</form>
<iframe name="myframe"><iframe>
post.php
<?php
$uname = $_post['username'];
$pw = $_post['password'];
if($uname =='admin' && $pw == '123') {
echo '登录成功';
}
?>
//或者
<?php
$uname = $_post['username'];
$pw = $_post['password'];
if($uname == 'admin' && $pw =='123'){?>
<script type="text/javascript">
parent.document.getElementById('info').innerHTML = '登录成功';
<script>
<?php}
?>