mohash
دوشنبه 11 خرداد 1388, 01:42 صبح
كد زير رو لوكال كار مي كنه ولي رو سايت كار نمي كنه و كوكي ست نمي شه مشكلش چيه؟
<?php
$expire=time()+36000;
setcookie("user", "ali", $expire);
?>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<body>
<?php
if (isset($_COOKIE["user"]))
echo "Welcome " . $_COOKIE["user"] . "!<br />";
else
echo "Welcome guest!<br />";
?>
</body>
</html>
<?php
$expire=time()+36000;
setcookie("user", "ali", $expire);
?>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<body>
<?php
if (isset($_COOKIE["user"]))
echo "Welcome " . $_COOKIE["user"] . "!<br />";
else
echo "Welcome guest!<br />";
?>
</body>
</html>