Hello,
I created a PHP page that included cookie, here is the PHP code:
<?php
if (isset($HTTP_POST_VARS['Name'])) {
setcookie("Name", $HTTP_POST_VARS['Name'], time()+86400*10);
}
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
</head>
<body>
<form name="form1" method="post" action="request.php">
<p>Name:
<input name="Name" type="text" id="Name">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
</body>
</html>
But when I called the cookie variable in another page, it showed
"Notice: Undefined index: Name in....". Here is the PHP code in another
page:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
</head>
<body>
HI!! <?php echo $HTTP_COOKIE_VARS['Name']; ?>
</body>
</html>
Any problems in my PHP pages? How to solve it?
THANKS!!
Terry
_________________________________________________________________
MSN 相簿提供您最簡單的方式分享並列印您的相片,請移至 :
http://photos.msn.com.hk/support/worldwide.aspx
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
- Re: [PHP] cookie problem.... Terry Lau
- Re: [PHP] cookie problem.... Jason Wong
- Re: [PHP] cookie problem.... Marek Kilimajer
- Re: [PHP] cookie problem.... Rick Emery
- RE: [PHP] cookie problem.... Bryan Lipscy