Home >php教程 >php手册 >php无刷新登陆

php无刷新登陆

WBOY
WBOYOriginal
2016-05-25 16:51:39972browse

<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;;
}


教程网址:

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn