php中cookie实现记住用户名与密码的代码(图文)

PHP中文网
发布: 2023-02-28 20:44:01
原创
1824 人浏览过

php cookie实现记住用户名与密码的代码

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<form id="form1" name="form1" method="post" action="check_remember.php">
<table width="300" border="1" align="center" cellpadding="0" cellspacing="0">
<thead>
<tr>
<td colspan="2" align="center"><b>记住用户名和密码</b></td>
</tr>
</thead>
<tr align="center">
<td>用 户 名:</td>
<td><input type="text" value="<?php echo $_COOKIE[&#39;name&#39;];?>" name="name"></td>
</tr>
<tr align="center">
<td>密码:</td>
<td><input type="password" name="password" value="<?php echo $_COOKIE[&#39;password&#39;]?>"></td>
</tr>
<tr align="center">
<td>记住用户名和密码</td>
<td><?php if($_COOKIE[&#39;remember&#39;] == 1){?><input type="checkbox" name="remember" value="1" checked>
<?php }else{($_COOKIE[&#39;remember&#39;] == "")?><input type="checkbox" name="remember" value="1"><?php }?></td>
</tr>
<tr align="center">
<td colspan="2"><input type="submit" name="Submit" value="提交" /></td>
</tr>
</table>
</form>
登录后复制

2、检测密码的页面-check_remember.php

以上就是php cookie实现记住用户名与密码的代码(图文) 的内容,更多相关内容请关注PHP中文网(m.sbmmt.com)!

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!