首页 >php教程 >php手册 >php无刷新登陆

php无刷新登陆

WBOY
WBOY原创
2016-05-25 16:51:39959浏览

<form action="login.php" method="post"  target="userlogin" name="loginform"> 
<div class="TxtUser" id="userlogindiv"> 
用户名:<input name="accounts" id="accounts" type="text"   size="18" > 
密码: <input name="passwords" id="passwords"  type="password"  size="18" > 
<input type="submit" name="Submit" value="登录" /> 
</div> 
</form> 
<iframe name="userlogin" width="1" height="1" ></iframe> 
//login.php页面: 
<?php
$accounts = $_POST[&#39;accounts&#39;];
$passwords = $_POST[&#39;passwords&#39;];
$showdata = "我登录啦!!";
if ($accounts == "admin" && $passwords == "123456") {
    echo &#39;<script language="JavaScript"> &#39;;
    echo &#39;parent.document.getElementById("userlogindiv").innerHTML=&#39;&#39;.$showdata.&#39;&#39;;&#39;;
    echo &#39;</script>&#39;;
}


教程网址:

欢迎收藏∩_∩但请保留本文链接。

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn