I did some homework
This commit is contained in:
36
20240918_gyak/index.php
Normal file
36
20240918_gyak/index.php
Normal 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>
|
||||
Reference in New Issue
Block a user