-
کوکی
سلام کسی هست که مشکل این کد رو به من بگه؟
<?php
setcookie("user",$_POST['user'], time()+3600);
if (isset($_COOKIE["user"]))
echo "Welcome " . $_COOKIE["user"] . "!<br />";
else
echo "Welcome guest!<br/>";
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="user.php" method="post">
<input type="text" name="user">
<input type="submit" name="Submit" value="ok">
</form>
</body>
</html>
-
عزیزم مشکلی نداره میتونی امتحانش کنی
[PHP]
<?php
error_reporting(0);
setcookie("user",$_POST['user'], time()+3600);
if($_GET['dis'] == 'on'){
unset($_SESSION);
}
elseif (isset($_COOKIE["user"]))
echo "Welcome " . $_COOKIE["user"] . "!<br />";
else
echo "Welcome guest!<br/>";
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="pos.php" method="post">
<input type="text" name="user">
<input type="submit" name="Submit" value="ok">
</form>
<a href="?dis=on">destroy();</a>
</body>
</html>
[/PHP]