作者在 2016-12-23 12:07:09 发布以下内容
<?php //setcookie("aa","123"); if(@$_GET['tj']=="提交"){ setcookie("user",$_GET['user']); setcookie("pwd",$_GET['pwd']); echo "<script>location.href=\"cookie.php\"</script>";//自动加载本页面一次 } echo "<br>用户名".$_COOKIE["user"]; echo "<br>密码".$_COOKIE["pwd"]; ?> <form action="cookie.php"> <input type="text" name="user"> <input type="password" name="pwd"> <input type="submit" value="提交" name="tj"> </form>