Home  >  Article  >  Backend Development  >  新手 cookie登陆有关问题

新手 cookie登陆有关问题

WBOY
WBOYOriginal
2016-06-13 11:33:391159browse

新手求助 cookie登陆问题

<br /><?php<br />include("conn.php");<br />if($_POST[id]=='admin'){<br />	$pw=md5($_POST[pw]);<br />	if($pw=='a9c449d4fa44e9e5a41c574ae55ce4d9')<br />	{<br />	    setcookie("cookie","ok");<br />		echo "<script language=\"javascript\">location.href='login.php';</script>";<br />	}<br />}<br />if($_COOKIE['cookie']!='ok')<br />{<br />?><br /><br /><SCRIPT language=javascript><br />function Checklogin()<br />{<br />	if(myform.id.value==""){<br />		alert("请填写登陆名");<br /><br />		myform.id.focus();<br />		return false;<br />	}<br />	if(myform.pw.value==""){<br />		alert("密码不能为空");<br />		myform.pw.focus();<br />		return false;<br />	}<br />}<br /></SCRIPT><br /><br /><form action="" method="post" name="myform" onsubmit="return Checklogin();" enctype="text/plain"><br />   id:<br />  <input type="text" name="id" /><br><br />  pw:<br />  <input type="password" name="pw" /><br><br /><br />  <input type="submit" name="submit" value="登陆"/><br /><br /></form><br /><br /><?php<br />}<br />else<br />{<br />?><br /><br /><a href='?out=login'>退出</a><br /><br /><?php<br />}<br />?><br />

登陆不了    请问怎么回事啊?

Statement:
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