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. Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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.