monkeynote Posted August 8, 2007 Share Posted August 8, 2007 hello guys! im so glad i shifted my code from ASP to PHP. the learning curve is tough coz im new to its syntax i have no problem with sessions / variables and database querys but the only problem that i have is a cookie problem <?php setcookie("test", "testing", time()+3600); echo @$_COOKIES["test"]; ?> within this code, im planning to display the value of the test cookie but it seems there's a null value on it i tried in all browsers but it doesnt work! ??? im using Windows XP, Apache 2.0 and PHP 5.2.3 thanks for reading my post guys Quote Link to comment https://forums.phpfreaks.com/topic/63879-solved-cookies-problem-in-wamp/ Share on other sites More sharing options...
flappy_warbucks Posted August 8, 2007 Share Posted August 8, 2007 Cookies dont work on the page they are set. so what you could do is set it on one page and have the browser forwarded to another page and it *should* work Quote Link to comment https://forums.phpfreaks.com/topic/63879-solved-cookies-problem-in-wamp/#findComment-318391 Share on other sites More sharing options...
jitesh Posted August 8, 2007 Share Posted August 8, 2007 Try this <?php setcookie("test", "testing", time()+3600); echo $_COOKIE["test"]; echo "<pre>"; print_r($_COOKIE); exit; ?> Quote Link to comment https://forums.phpfreaks.com/topic/63879-solved-cookies-problem-in-wamp/#findComment-318395 Share on other sites More sharing options...
monkeynote Posted August 8, 2007 Author Share Posted August 8, 2007 thanks guys for all the replies to jitesh... thank you very much! $_COOKIE["value"] and not $_COOKIES["value"]!!! im so s2pid ??? Quote Link to comment https://forums.phpfreaks.com/topic/63879-solved-cookies-problem-in-wamp/#findComment-318453 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.