asd
This commit is contained in:
5
20240916/footer.php
Normal file
5
20240916/footer.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
echo '<div style="position: absolute; bottom: 3px;width: 100%;text-align: center; height: 30px; background: black; color: white;">
|
||||
Készítette Szabó Márton (c)2024
|
||||
</div>';
|
||||
?>
|
||||
24
20240916/index.php
Normal file
24
20240916/index.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php require_once 'negy.php'; ?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Alap web valami</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1>
|
||||
POST használata
|
||||
</h1>
|
||||
<?php
|
||||
if ($islogin == false){
|
||||
require 'loginform.php';
|
||||
|
||||
} else {
|
||||
require 'logged.php';
|
||||
}
|
||||
?>
|
||||
<?php require_once 'footer.php'; ?>
|
||||
</body>
|
||||
</html>
|
||||
9
20240916/logged.php
Normal file
9
20240916/logged.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<h3>
|
||||
Üdvözöllek
|
||||
|
||||
<?php
|
||||
echo $nev;
|
||||
?>
|
||||
</h3>
|
||||
|
||||
<a href="index.php"> KIJELENTKEZÉS</a>
|
||||
6
20240916/loginform.php
Normal file
6
20240916/loginform.php
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
<form method="Post">
|
||||
Login: <input type="text" name="nev" title="Add meg a neved"><br>
|
||||
Jelszó: <input type="password" name="jelszo" title="Jelszó"><br>
|
||||
<button type="submit">Belépés</button>
|
||||
</form>
|
||||
18
20240916/negy.php
Normal file
18
20240916/negy.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
$islogin = false;
|
||||
|
||||
if (isset($_POST["nev"]) && isset($_POST["jelszo"])) {
|
||||
$nev = $_POST["nev"];
|
||||
$jelszo = $_POST["jelszo"];
|
||||
|
||||
if(strlen($nev) > 3 && strlen($jelszo) > 4){
|
||||
if ($nev == 'admin' && $jelszo == 'admin'){
|
||||
$islogin = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user