Click here to Skip to main content
15,560,618 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
i have validation.php:
if ($_REQUEST['myusername']!="" and $_REQUEST['mypassword']!="")
{
require('conect.php');
$link=conect();

$myusername=$_POST['myusername'];
$mypassword=$_POST['mypassword'];

$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
$myusername = mysql_real_escape_string($myusername);
$mypassword = mysql_real_escape_string($mypassword);

$table = "users";
$consult = "select type from $tabla where idusuario='$myusername' and clave='$mypassword'";
$result=mysql_query($consult);
$numreg=mysql_num_rows($result);
 	if($numreg!=0)
    {
    	$_REQUEST['type']=mysql_result($result,$i);
        if ($_REQUEST['type']=='1')
        {
			$_SESSION["valid"]= "y";
			header("location:menuadmin.php");
        }
		else
		{
			$_SESSION["valid"]= "y";
			header("location:comentario.php");
		}
	}
	else
    {
		echo "Login o password incorrect.";
    	header("refresh:1;url=index.php");
	}
}
else
   {
    	echo "Login o password incorrect.";
    	header("refresh:1;url=index.php");
    }
 ?>

also have my menuadmin.php where theres a button to logout:
XML
<?php
session_start();
if($_SESSION["valid"]!="y"){
header("location:exit.php");
}
?>
<html>
<head>
</head>
<body>
<a href="exit.php">CLose Session</a>
</body>
</html>

and exit.php
XML
<?
session_start();
session_destroy();
?>
<html>
<head>
</head>
<body>
<?php
header("location:index.php");
?>
</body>
</html>

It doesnt close the session i can still type in the url www.mydomain.com/menuadmin.php and shows me evetything i have tried with session uset also array but nothing please help me!!
THANKS
Posted
Updated 2-Feb-11 10:15am
v2
Comments
fjdiewornncalwe 2-Feb-11 20:43pm    
Try closing your browser application completely and then relaunch it and try the url again. What happens in that situation?

1 solution

If this is what you mean, deleting PHP session: here is the code
unset($_SESSION['session_name']);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900