如何进行PHP登录? [英] How to make a PHP login?
本文介绍了如何进行PHP登录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在研究如何进行PHP登录,但我能想到的只有。
I was researching about how to make a php login but all I could come up with was.
<?PHP<br />
$uandp = file_exists($_POST["username"]."user".md5($_POST["password"]).".usr");<br />
if ($uandp=="1") {<br />
$myfile = fopen("access.port", "w") or die("Unable to login!");<br />
$txt = "John Doe\n";<br />
fwrite($myfile, $txt);<br />
$txt = "Jane Doe\n";<br />
fwrite($myfile, $txt);<br />
fclose($myfile);<br />
header("Location: adm1.php");<br />
} else {<br />
header("location: error.php");<br />
}<br />
?>
哪个不太安全。如何用php和cookies(包括moble用户)做一个?
Which is not very secure. How can I do one with php and cookies(including moble users)?
推荐答案
uandp = file_exists(
uandp = file_exists(
_POST [ username]。user.md5(
_POST["username"]."user".md5(
_POST [password])。。usr);< br />
if(
_POST["password"]).".usr");<br /> if (
这篇关于如何进行PHP登录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文