title: How to store java toggle as value in sql?
body: <p>I have a shoutbox as an overlay on my website (it's always displayed) which you can minimize and enlarge by pressing a button (toggle). </p>
  
  <p>The problem is, that when I go to different pages on my website, the shoutbox initially is always open. This is annoying. I would like to store the information of whether the user has minimized the shoutbox or not (eg in a sql db), so that the state of the shoutbox does not always go back . </p>
  
  <p>Any help would be appreciated!!</p>
  
  <p>Below the code of my shoutbox:</p>
  
  <pre><code>load_data = {'fetch':1};
   $.post('&lt;?php echo THEMEPATH; ?&gt;/shout.php', load_data,  function(data) {
      $('.message_box').html(data);
      var scrolltoh = $('.message_box')[0].scrollHeight;
      $('.message_box').scrollTop(scrolltoh);
   });
  
  //method to trigger when user hits enter key
  $("#shout_message").keypress(function(evt) {
      if(evt.which == 13) {
              var iusername = "&lt;?php echo $login; ?&gt;";
              var imessage = $('#shout_message').val();
              post_data = {'username':iusername, 'message':imessage};
  
              //send data to "shout.php" using jQuery $.post()
              $.post('&lt;?php echo THEMEPATH; ?&gt;/shout.php', post_data, function(data) {
  
                  //append data into messagebox with jQuery fade effect!
                  $(data).hide().appendTo('.message_box').fadeIn();
  
                  //keep scrolled to bottom of chat!
                  var scrolltoh = $('.message_box')[0].scrollHeight;
                  $('.message_box').scrollTop(scrolltoh);
  
                  //reset value of message box
                  $('#shout_message').val('');
  
              }).fail(function(err) { 
  
              //alert HTTP server error
              alert(err.statusText); 
              });
          }
  });
  
  //toggle hide/show shout box
  $(".close_btnn").click(function (e) {   
      //get CSS display state of .toggle_chat element
      var toggleState = $('.toggle_chat').css('display');
  
      //toggle show/hide chat box
      $('.toggle_chat').slideToggle();
  
      //use toggleState var to change close/open icon image
      if(toggleState == 'block')
      {
          $(".header div").attr('class', 'open_btnn');
      }else{
          $(".header div").attr('class', 'close_btnn');
      }
  
  
  });
  </code></pre>