<html>
<body>
<table border=3>
<form action=checkpass.php method=post>
<tr>
<td>userid</td>
<td><input type=text name=n1></td>
</tr><br>
<tr>
<td>password</td>
<td><input type=password name=n2></td>
</tr><br>
<tr>
<td><input type=submit value=login></td><br>
<td><a href=registration.html>Create new account</a></td>
</tr>
</form>
</table>
</body>
</html>
//checkpass.php
<?php
session_start();
include "connect.php";
?>
<?php
$userid=$_POST['username'];
$password=$_POST['password'];
$q="select * from cust_details where userid='".$userid."' and password='".$password."'";
$s=mysql_query($q);
if($r=mysql_fetch_array($s)){
$name=$r["firstname"];
$_SESSION['userid']=$userid;
header("location:home.php?name=".$name);
}
else{
?>
<font color=red>Invalid user id or password</font>
<?php
include "login.html" ;
?>
<?php
}
mysql_close();
?>
//home.php
<?php
$name=$_GET['name'];
echo "WelCome ".$name;
?>
//logout.php
<?php
session_start();
session_destroy();
header("location:checkpass.php?message=2");
?>
here is my entire login session..but i cant logout successfully,i want to show my user "you have successfully loged out" after clicking on logout link.if anybody can then see my code and tell me what went wrong.It would be greatly appreciated.