CodeIgniter Forums
How to get a button to save session data? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: How to get a button to save session data? (/showthread.php?tid=31249)



How to get a button to save session data? - El Forum - 06-11-2010

[eluser]kaos78414[/eluser]
I know the topic is a little confusing but I was having trouble figuring out how to word it.

I have a little about-us kinda div on the front page, and added some jquery to make it closeable for those who find it annoying. What I'm wondering, is if there is a way that I can make it so that when you press the close button, session data is added that basically says that you closed it, so it doesn't pop back up until the session expires.

I'm not sure if I can do this solely with PHP, or if there is some javascript involved.

The jquery involved is short and sweet, if you need to see it, it looks like this:
Code:
$(document).ready(function(){

$('a#hide-button').click(function(){
$('#about-box').slideUp('fast');
});

});

Any ideas as to how this can be accomplished?


How to get a button to save session data? - El Forum - 06-11-2010

[eluser]Eric Barnes[/eluser]
I believe you would just use cookies in the javascript code. I know jquery supports this.


How to get a button to save session data? - El Forum - 06-11-2010

[eluser]ram4nd[/eluser]
Look into ajax at jquery Docs. About post and get.