这里是新手问题.. 我有如下登录代码,使用以下代码需要 session 全局打开才能运行。问题是如何修改代码,使其能够与 session 全局关闭一起工作?请建议..
<?
session_start();
if(isset($submit) )
{
include ("config.php");
include ("../dbcon.php");
include ("functions.php");;
$result=mysql_query("select * from users where login='$username'");
$row=mysql_fetch_array($result);
$pasw=$row["pass"];
}
if($pasw==$password){
$HTTP_SESSION_VARS['l']=$username;
$HTTP_SESSION_VARS['p']=$password;
Header("Location: ../index.php");
exit;
}
else
header("Location: ../index.php?page=loginfailed");
?>
最佳答案
使用 $_SESSION['variable_name'] 而不是全局注册 HTTP_SESSION_VARS
关于php - 如何修改以下需要全局 session 打开到全局 session 关闭的代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19151725/