PHP会话未关闭,帮助 [英] PHP session doesnt close, HELP
本文介绍了PHP会话未关闭,帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有validation.php:
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");
}
?>
也有我的menuadmin.php,其中有一个用于注销的按钮:
also have my menuadmin.php where theres a button to logout:
<?php
session_start();
if($_SESSION["valid"]!="y"){
header("location:exit.php");
}
?>
<html>
<head>
</head>
<body>
<a href="exit.php">CLose Session</a>
</body>
</html>
然后退出.php
and exit.php
<?
session_start();
session_destroy();
?>
<html>
<head>
</head>
<body>
<?php
header("location:index.php");
?>
</body>
</html>
它没有关闭会话,我仍然可以在URL www.mydomain.com/menuadmin.php中输入内容,并向我显示我已尝试使用会话uset的所有内容,但没有任何帮助,请帮我!
谢谢
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
推荐答案
_REQUEST [''myusername'']!="和
_REQUEST[''myusername'']!="" and
_REQUEST ["mypassword"] !=") { require(''conect.php'');
_REQUEST[''mypassword'']!="") { require(''conect.php'');
link = conect();
link=conect();
这篇关于PHP会话未关闭,帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文