brown2005 Posted April 18, 2009 Share Posted April 18, 2009 i have created a bottom bar which at the moment i have set to 200px high. what i want to do is say have a link in it. and when i click it, set a cookie and make it only 100px high. but have got no clues about cookies at all. Link to comment https://forums.phpfreaks.com/topic/154654-cookies/ Share on other sites More sharing options...
Anxious Posted April 18, 2009 Share Posted April 18, 2009 Research about cookies, you'll probably find some code you can edit yourself. If you don't find any codes, it'll give you a better idea on how to design one. Link to comment https://forums.phpfreaks.com/topic/154654-cookies/#findComment-813257 Share on other sites More sharing options...
soak Posted April 18, 2009 Share Posted April 18, 2009 You could do the setting of the cookie in javascript quite easily as well which would save a trip to the server. Link to comment https://forums.phpfreaks.com/topic/154654-cookies/#findComment-813263 Share on other sites More sharing options...
schilly Posted April 18, 2009 Share Posted April 18, 2009 You could do the setting of the cookie in javascript quite easily as well which would save a trip to the server. as well as change the height of the bar. Link to comment https://forums.phpfreaks.com/topic/154654-cookies/#findComment-813265 Share on other sites More sharing options...
brown2005 Posted April 18, 2009 Author Share Posted April 18, 2009 <?php setcookie("myCookie", "PHP Tutorial", time()+3600); ?> <html> <body> <?php echo "The cookie value is ".$_COOKIE['myCookie']; ?> </body> </html> why does this not work? i have never ever done anything on cookies, so just got that from a tutorial. Link to comment https://forums.phpfreaks.com/topic/154654-cookies/#findComment-813274 Share on other sites More sharing options...
brown2005 Posted April 18, 2009 Author Share Posted April 18, 2009 ok so the cookie is working. now say i have <a href="">Click here to reduce the height of this bar</a> what would I do now? Link to comment https://forums.phpfreaks.com/topic/154654-cookies/#findComment-813281 Share on other sites More sharing options...
Anxious Posted April 19, 2009 Share Posted April 19, 2009 First of all, you need to make the function without a cookie, and get it to reduce the height, or increase the height, or by value etc. If that works, then you'll start to setup the cookie. So that cookie you create works? You'll need to set the cookie so that it knows what its actually meant to be saving. Which would be the height of the bar. Link to comment https://forums.phpfreaks.com/topic/154654-cookies/#findComment-813743 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.