php无刷新登陆
来源:程序员人生 发布时间:2013-11-07 01:30:55 阅读次数:3881次
- <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>
-
- <?
- $accounts=$_POST['accounts'];
- $passwords=$_POST['passwords'];
- $showdata="我登录啦!!";
- if($accounts=="admin" && $passwords=="123456")
- {
- echo'<script language="JavaScript"> ';
- echo'parent.document.getElementById("userlogindiv").innerHTML=''.$showdata.'';';
- echo'</script>';
- }
- ?>
生活不易,码农辛苦
如果您觉得本网站对您的学习有所帮助,可以手机扫描二维码进行捐赠