Nieuw lid |
|
Jo jongens,
De titel zegt het wel:
$_SESSION werkt niet !!
Ik heb:
<?php
ob_start();
if($_SERVER['REQUEST_METHOD'] == 'POST'){
if(!isset($_SESSION['admin_logged'])){
$uName = $_POST['loginname'];
$uPass = $_POST['loginpass'];
$login_sql = "SELECT loginname FROM adminlist WHERE loginname = '$uName' AND password = '$uPass'";
$login_res = mysql_query($login_sql);
if($login_res){
$uCount = "SELECT alevel FROM adminlist WHERE loginname = '$uName' AND password = '$uPass'";
$uResult = mysql_query($uCount);
$uLevel = mysql_num_rows($uResult);
if($uLevel != 0){
$_SESSION['admin_logged'] = true;
$_SESSION['admin_name'] = $uName;
$_SESSION['admin_level'] = $uLevel;
echo "Ingelogd... blaat";
}
else{
echo "Je bent level 0 admin, oftewel NIET admin";
}
}
else{
echo "Stomme MYSQL error...";
}
}
else{
header('location: admPanel.php');
}
}
else{
header('location: login.php');
}
ob_end_flush();
?>
<?php if($_SERVER['REQUEST_METHOD'] == 'POST'){ if(!isset($_SESSION['admin_logged'])){ $uName = $_POST['loginname']; $uPass = $_POST['loginpass']; $login_sql = "SELECT loginname FROM adminlist WHERE loginname = '$uName' AND password = '$uPass'"; if($login_res){ $uCount = "SELECT alevel FROM adminlist WHERE loginname = '$uName' AND password = '$uPass'"; if($uLevel != 0){ $_SESSION['admin_logged'] = true; $_SESSION['admin_name'] = $uName; $_SESSION['admin_level'] = $uLevel; echo "Ingelogd... blaat"; } else{ echo "Je bent level 0 admin, oftewel NIET admin"; } } else{ echo "Stomme MYSQL error..."; } } else{ header('location: admPanel.php'); } } else{ header('location: login.php'); } ?>
Dit is niet het hele script ;)
Er zit nog meer SQL etc in.
Als ik het hele script doet wordt het te groot, en ik heb geen zin om naar plaatscode.be of pastebin.com te gaan
Maar kan iemand me helpen?
Want cookies wil ik ook niet ;)
|