初心者向けヘルプ 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 />