I'm building a login system. My database looks like this
Lets say, after loggin in, the code recognizes who is currently logged in and sends them to a specific website, based on the content in their KURS field.
So user yyy would be send to lets say TG111.php
And user uuu would be send to lets say TG112.php
TG111.php looks like this
<?php
session_start();
$sess = $_SESSION['KURS'];
if ($sess !== 'TG111') {
if ($sess !== 'TG112') {
if ($sess !== 'TG113') {
header("Location: index.php");
exit();
}
else {
header("Location: TG113.php");
exit();
}
}
else {
header("Location: TG112.php");
exit();
}
}
else {
header('Location: TG111.php');
exit();
}
?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Hello</title>
</head>
<body>
<a href="logout.php">Abmelden</a>
</body>
</html>
But this doesn't work...
I'm not sure what you're looking for? but you can try to debug it to see what the problem, you can try using this in your if statement
if($sess == 'TG111') {
header('Location: TG111.php');
exit();
} elseif ($sess == 'TG112') {
header("Location: TG112.php");
exit();
} elseif ($sess == 'TG113') {
header("Location: TG113.php");
exit();
} else {
header("Location: index.php");
exit();
}
How we can insert header and footer in google docs with google docs api using PHP code
Writing a new and appending a file in PHP without erasing contents
How to combine 2 arrays with the condition that 2 and 5 values will be from the second array?
How to keep the ?error on url if page extension not included?
I'm currently writing a chat program in PHP and AJAX and have PHPMailer installed and in use
I'm attempting to convert a piece of PHP code to dart and I came across a few things I've simply never used before, one of which is a single pipe |Im not sure what the exact dart equivalent is, if there even is one
I'm trying to convert a piece of PHP code to dart and getting stuckWhat I have is a PHP array text that gets run through a function called toUTF8 as follows:
I have a Details page that displays "short description", "Duration", and "description of tour" from a database