title: Disappearing logout button with html, jquery, and php
body: <p>I'm a very green programmer and can't find an answer anywhere on the web for my problem.  Thanks for any help you send my way! I'm trying to make a basic login page for users that allows an upload and also allows the user to logout. During login, I start a session. It works.  For both the upload and the logout, I'm using the jquery.form.js library to take advantage of the form functionality. For the upload portion of my code, everything works fine. The user can upload images of any type, the button is deactivated during the upload, then reactivated after success for new uploads. However, for the logout portion, after clicking the logout button and destroying the session, the logout button just disappears. I thought that it may have to do with the session destroy, but even without that in my php, the button is gone.  I copied the logout portion of my code below, in order, html, js, and php.  Any ideas?  Thanks!</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;Sample&lt;/title&gt;
          &lt;meta http-equiv= "Content-Type" content="text/html; charset=UTF-8"&gt;
              &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"&gt;&lt;/script&gt;
              &lt;script type = "text/javascript" src = "js/jquery.form.js"&gt;&lt;/script&gt;    
              &lt;script type = "text/javascript" src = "js/xmlRequest.js"&gt;&lt;/script&gt;
              &lt;script&gt;xmlRequest = new xmlRequest();&lt;/script&gt;
              &lt;script type = "text/javascript" src = "js/fileUpload.js"&gt;&lt;/script&gt;
              &lt;script&gt;fileUpload = new fileUpload();&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id = 'userLogout'&gt;
              &lt;form action="php/logout.php" id = "logoutSection" enctype = "multipart/form-data" method = "post" &gt;
                  &lt;button type="submit" id="logoutButton"&gt;Close!&lt;/button&gt;
              &lt;/form&gt;
          &lt;/div&gt;
  
          &lt;div id = 'logOutOutput'&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  
  
  
  function fileUpload()
  {   
  $(document).ready(function()
      {   
          $('#logoutSection').on('submit',function(a){
  
                  //prevent default action of going to new page.
                  a.preventDefault();
                  $('#logoutButton').attr('disabled','');
                  $(this).ajaxSubmit({
                      target: '#userLogout',
                      success: afterLogout//output a thank you message
                  });
                  $('#loginForm').show();
                  $('#logOutOutput').append("&lt;br&gt;Thanks for checking us out!&lt;br&gt;");
              });
      });
  
      function afterLogout()
      {
          $('#logoutSection').resetForm();
          $('#logoutButton').removeAttr('disabled');
      }
  }
  
  
  &lt;?php
      echo "&lt;br&gt;Goner&lt;br&gt;";
      session_start();//always required for sessions
      session_destroy();//logs out
  ?&gt;
  </code></pre>