I did some homework

This commit is contained in:
Digi
2024-09-18 20:24:12 +02:00
parent dc5ff7ddad
commit 6ebd347e44
9 changed files with 111 additions and 0 deletions

36
20240918_gyak/index.php Normal file
View File

@@ -0,0 +1,36 @@
<?php
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<?php
//echo $_POST['name'];
setcookie("suti", "Digi", time() - 86400);
$_SESSION['username'] = "digivagyok";
echo $_SESSION['username'];
if (!isset($_SESSION['username'])){
echo "You are not logged in";
} else {
echo "You are logged in";
}
?>
<form method="POST">
<input type="hidden" name="name" value="Digi">
<button type="submit">PRESS ME!</button>
</form>
<a href="second.php">ASD</a>
</body>
</html>