Jquery not working
<p>For some reason, my jQuery isn't working properly, and I can't spot the mistake, although I may have some idea. Below is some of the code from group2.php, its for a chat application:</p>

<pre><code>&lt;div id="wrapper"&gt;
    &lt;div id="menu"&gt;
        &lt;p class="welcome"&gt;Welcome, &lt;b&gt;&lt;?php echo $_SESSION['name']; ?&gt;&lt;/b&gt;&lt;/p&gt;
        &lt;p class="logout"&gt;&lt;a id="exit" href="?logout=1"&gt;Exit Group&lt;/a&gt;&lt;/p&gt;
        &lt;div style="clear:both"&gt;&lt;/div&gt;
    &lt;/div&gt;  

   if(isset($_GET['logout'])){  
     $fp = fopen("log.html", 'w');
     fwrite($fp, "");
     fwrite($fp, "&lt;div class='msgln'&gt;&lt;i&gt;User " . $_SESSION['name'] . " has left the chat session.&lt;/i&gt;&lt;br&gt;&lt;/div&gt;");
     fclose($fp);       
     session_destroy();
     header("Location: main.php"); //Redirect the user        
     }



?&gt;
&lt;/div&gt;
</code></pre>

<p><strong>While below is jQuery, which is also in group2.php, where I am trying to see if the user clicked logout, then we should direct to main.php?logout=true</strong></p>

<pre><code>//If user wants to end session
    $("#exit").click(function(){
      var exit = confirm("Are you sure you want to end the session?");
      if(exit==true){ window.location = 'main.php?logout=true';
      }
    }); 
</code></pre>

<p>While I am able to execute the code within <code>if(isset($_GET['logout']))</code>, and ask the user whether they would like to leave the room, I am unable to direct the user to <code>main.php?logout=true</code> after they click 'ok' to the question 'Want to end session?'. Instead, the user is being directed to <code>?logout=1</code>. Any suggestions on what I'm doing wrong? Thank you.</p>
