Show sourcecode
The following files exists in this folder. Click to view.
webbserverprogrammering/exercises/mysqlintro/inlogg/
admin.php
dbconnection.php
deletepost.php
hemlig.php
index.php
insertpost.php
lås.php
selectposts.php
updatepost.php
lås.php
17 lines UTF-8 Windows (CRLF)
<?php
if (isset($_GET["logut"])) {
session_start();
$_SESSION["admin"] = "false";
}
if(isset($_SESSION["admin"]) && $_SESSION["admin"] === "true"){
?>
<form method="get" action="lås.php">
<input type="submit" name="logut" value="Logga ut">
</form>
<?php
}
else{
header("location: index.php");
exit();
}
?>