$_SESSION
값을 만들고 싶습니다. 정상적인 페이지에서만 값을 지정합니다. 스위치/케이스를 사용하면 값을 얻을 수 없습니다. 누군가 나를 도울 수 있습니까?
스위치/케이스 : 이것은 세션
$egn = $_POST['student'];
validegn($egn);
$_SESSION['favcolor'] = $egn;
header("location:../index.php");
의 창조에서 링크를 만들려는 코드가이 내가 할 마지막 페이지입니다
switch($_GET['act'])
{
case 'login':
include('./include/login.php'); break;
case 'logout':
include('./include/logout.php'); break;
case 'help':
include('./include/help.php'); break;
case 'help2':
include('./include/help.php'); break;
case 'contact':
include('./include/contat.php'); break;
case 'admin':
include('./include/admin.php'); break;
case 'moderate':
include('./include/moderate.php'); break;
case 'check':
include('./include/check.php'); break;
case 'belevki':
include('./include/belevki.php'); break;
case 'register':
include('./include/register.php'); break;
case 'ls':
include('./include/ls.php'); break;
case 'los':
include('./include/los.php'); break;
case 'profile':
include('./include/profile.php'); break;
case 'srok':
include('./include/check1visrok.php'); break;
default: // разглеждане на index-a
include('./include/index.php');
}
당신이 header('location: ../index.php)
를 통해 리디렉션을 수행 할 때 값
$egn = $_SESSION['favcolor'];
echo $_SESSION['favcolor'];
아마도 var에 액세스하기 전에 세션을 시작해야합니까? @session_start(); – Vygandas
나는 session_start()를 가지고있다; 어디 에나 – user3315719