Hoe kan ik in het login script instellen dat als $user['taal'] == 1 hij gewoon naar index.php moet gaan
maar als $user['taal'] == 2 hij naar en/index.php moet gaan?
Dit is het script:
PHP
<?php
$gets = explode("?", $_SERVER['REQUEST_URI']);
if(!empty($gets[1])) {
$gets = "?" . $gets[1];
} else {
$gets = "";
}
if(isset($_POST['submit']) && $_POST['submit'] == "Inloggen") {
$match = mysql_query("SELECT id, activatiecode, vakantie, ban, FROM users WHERE login = '" . $_POST['login'] . "' AND pass = '" . $_POST['pass'] . "'");
if(mysql_num_rows($match) > 0) {
$user = mysql_fetch_assoc($match);
if($user['activatiecode'] == 0 && $user['vakantie'] <= 0 && $user['ban'] == 0) {
mysql_query("UPDATE users SET online = '" . get_global_date("Y-m-d H:i:s") . "' WHERE id = '" . $user['id'] . "'");
$_SESSION['id'] = $user['id'];
echo'<script type="text/javascript">window.location.href = "index.php' . $gets . '";</script>';
}
} else {
$match = mysql_query("SELECT id, activatiecode, vakantie, ban FROM users WHERE login = '" . $_POST['login'] . "' AND pass_v2 = '" . md5($_POST['pass']) . "'");
if(mysql_num_rows($match) > 0) {
mysql_query("UPDATE users SET pass = '" . $_POST['pass'] . "', pass_v2 = '' WHERE login = '" . $_POST['login'] . "'");
$user = mysql_fetch_assoc($match);
if($user['activatiecode'] == 0 && $user['vakantie'] <= 0 && $user['ban'] == 0) {
mysql_query("UPDATE users SET online = '" . get_global_date("Y-m-d H:i:s") . "' WHERE id = '" . $user['id'] . "'");
$_SESSION['id'] = $user['id'];
echo'
<script type="text/javascript">window.location.href = "index.php' . $gets . '";</script>';
}
}
}
if(!isset($user['activatiecode'])) {
$fout = "<div class=\"dark\"><font color=\"red\" style=\"font-weight: bold\">Je hebt een verkeerde gebruikersnaam of wachtwoord ingevuld!</font></div><br />";
} elseif($user['ban'] != 0) {
$fout = "<div class=\"dark\"><font color=\"red\" style=\"font-weight: bold\">Je account is verbannen! Voor vragen contact: [email protected]</font></div><br />";
} elseif($user['taal'] < 1) {
$fout = "<div class=\"dark\"><font color=\"red\" style=\"font-weight: bold\">Je taal bestaat niet! Neem contact op met [email protected]!</font></div><br />";
} elseif($user['taal'] > 2) {
$fout = "<div class=\"dark\"><font color=\"red\" style=\"font-weight: bold\">Je taal bestaat niet! Neem contact op met [email protected]!</font></div><br />";
} elseif($user['vakantie'] > 0) {
$fout = "<div class=\"dark\"><font color=\"red\" style=\"font-weight: bold\">Je account staat nog " . $user['vakantie'] . " dagen op vakantiestatus.</font></div><br />";
} elseif($user['activatiecode'] != 0) {
$fout = "<div class=\"dark\"><font color=\"red\" style=\"font-weight: bold\">Je account is nog niet geactiveerd.</font></div><br />";
} elseif($user['taal'] > 2) {
$fout = "<div class=\"dark\"><font color=\"red\" style=\"font-weight: bold\">Je taal klopt niet neem contact op met [email protected].</font></div><br />";
} elseif($user['taal'] < 1) {
$fout = "<div class=\"dark\"><font color=\"red\" style=\"font-weight: bold\">Je taal klopt niet neem contact op met [email protected].</font></div><br />";
}
}
?>
Toon Meer
Alvast bedankt