PHP速学教程(入门到精通)
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
.htpasswd 主要是 apache 使用的基于文件的用户名和密码的存储
<?php // - - - - - - - - - - - - - - - - - - - // Author: Christopher Hair // Website: www.chrishair.co.uk // - - - - - - - - - - - - - - - - - - - if (isset($_POST['submit'])){ $error = ''; $username = trim(stripslashes($_POST['username'])); $password = trim(stripslashes($_POST['password'])); if ($username == '' || preg_match('/\s/m', $username)) { $error .= "<p><strong>Invalid Username.</strong>\n"; } if ($password == '' || preg_match('/\s/m', $password)) { $error .= "<p><strong>Invalid Password.</strong></p>\n"; } if ($error == '') { echo "<p>Success</p>\n"; echo "<h1>" . htmlspecialchars($username) . ":" . crypt($password) . "</h1>\n"; } else { echo $error; } } ?>
以上就是PHP 生成 .htpasswd 文件的用户名和密码的内容,更多相关内容请关注PHP中文网(www.php.cn)!
php免费学习视频:立即学习
踏上前端学习之旅,开启通往精通之路!从前端基础到项目实战,循序渐进,一步一个脚印,迈向巅峰!
已抢7325个
抢已抢95407个
抢已抢14926个
抢已抢52642个
抢已抢195813个
抢已抢87478个
抢