Logout in PHP using button onclick event
<p>I'm just implementing a login and logout system in PHP and experiencing problems with logout. The system outline is as follows:</p>

<ol>
<li>When the user logs in, a session is created with a session variable "user".</li>
<li>After the session is set up, the user is redirected to <code>index.php</code> file.</li>
<li>In that file, a logout button is placed. When the user clicks the logout button session should be destroyed.</li>
</ol>

<p>I've designed the 2 steps above but can't perform the logout action when the <strong>button is clicked</strong>. How to do that? By using <strong>Javascript</strong> or any other ideas?</p>
