I did some homework
This commit is contained in:
parent
dc5ff7ddad
commit
6ebd347e44
3
20240918_gyak/footer.php
Normal file
3
20240918_gyak/footer.php
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<footer>
|
||||||
|
MADE BY DIGI (c) 2024
|
||||||
|
</footer>
|
13
20240918_gyak/frontpage.php
Normal file
13
20240918_gyak/frontpage.php
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<?php include 'header.php' ?>
|
||||||
|
<?php include 'isloggedin.php' ?>
|
||||||
|
<body>
|
||||||
|
<?php
|
||||||
|
if (!$isloggedin) {
|
||||||
|
require 'login.php';
|
||||||
|
} else {
|
||||||
|
require 'loggedin.php';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<?php include 'footer.php' ?>
|
||||||
|
</body>
|
||||||
|
</html>
|
12
20240918_gyak/header.php
Normal file
12
20240918_gyak/header.php
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<link rel="stylesheet" href="style.css">
|
||||||
|
<title>PHP</title>
|
||||||
|
</head>
|
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>
|
7
20240918_gyak/isloggedin.php
Normal file
7
20240918_gyak/isloggedin.php
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?php
|
||||||
|
$isloggedin = false;
|
||||||
|
|
||||||
|
if (isset($_POST['username']) && isset($_POST['password'])){
|
||||||
|
$isloggedin = true;
|
||||||
|
}
|
||||||
|
?>
|
7
20240918_gyak/loggedin.php
Normal file
7
20240918_gyak/loggedin.php
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<h1>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
echo "Üdvözöllek: ".$_POST['username'];
|
||||||
|
?>
|
||||||
|
|
||||||
|
</h1>
|
5
20240918_gyak/login.php
Normal file
5
20240918_gyak/login.php
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<form method="POST">
|
||||||
|
Felhasználónév: <input type="text", name="username", value=""><br>
|
||||||
|
Jelszó: <input type="password", name="password", value=""><br>
|
||||||
|
<button type="submit">Bejelentkezés</button>
|
||||||
|
</form>
|
16
20240918_gyak/second.php
Normal file
16
20240918_gyak/second.php
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
<?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 $_SESSION['username'];
|
||||||
|
?>
|
||||||
|
</body>
|
||||||
|
</html>
|
12
20240918_gyak/style.css
Normal file
12
20240918_gyak/style.css
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
body{
|
||||||
|
background-color: aqua;
|
||||||
|
color: blueviolet;
|
||||||
|
font-size: large;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer{
|
||||||
|
background-color: black;
|
||||||
|
width: 100%;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 3px;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user