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

php无刷新登陆

WBOY
Release: 2016-05-25 16:51:39
Original
979 people have browsed it

<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;;
}
Copy after login


教程网址:

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template