新手 cookie登陆有关问题

WBOY
Release: 2016-06-13 11:33:39
Original
1157 people have browsed it

新手求助 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 />
Copy after login

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template