form submit inside navigation menu
what i need is this
my php code is:
class logout{
public function __construct(){
session_unset();
session_destroy();
session_write_close();
setcookie(session_name(),'',0,'/');
session_regenerate_id(true);
}
}
if(!empty($_POST['logout'])){
$object=new logout();
}
for this i'm using the html code:
<ul id="navlist">
<li><a href="index.php">Home</a></li>
<li><a href="dates.php">Dates</a></li>
<li><a href="candidate.php">Candidates</a></li>
<li><a href="database.php">Database</a></li>
<li><a href="password.php">Change Password</a></li>
<li><a href='logout.php'>Log Out</a></li>
</ul>
for logout i need to do javascript form submit from an anchor which i've
read is not secure.
if i do like this:
<li><a href=''><form method="post"><input type='submit' value='Log Out'
name='logout' style="border:0px;" /></form></a></li>
i'm getting something like this:
how to solve the problem (do i've to use javascript any how to submit the
form?)
No comments:
Post a Comment