first commit
This commit is contained in:
23
Suli/13.b/Backend/2024. 09. 06/elso.php
Normal file
23
Suli/13.b/Backend/2024. 09. 06/elso.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
$kiirando = "Kaki<br>";
|
||||
echo $kiirando;
|
||||
$kiirando = "It's PHP<br>";
|
||||
echo $kiirando;
|
||||
$kiirando = 12;
|
||||
echo $kiirando * 3;
|
||||
$cim = "Kaka"
|
||||
?>
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>PHP-s html</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1><?php echo $cim?></h1>
|
||||
<?php
|
||||
var_dump($kiirando);
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
53
Suli/13.b/Backend/2024. 09. 09/masodik.php
Normal file
53
Suli/13.b/Backend/2024. 09. 09/masodik.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
define("KONSTVER", "20240909");
|
||||
|
||||
echo KONSTVER;
|
||||
echo "<br>";
|
||||
|
||||
$tomb = array("hétfő", "kedd", "szerda", "csütörtök", "péntek");
|
||||
|
||||
var_dump($tomb);
|
||||
|
||||
echo "<br>Az első elem a tömbben: ".$tomb[0];
|
||||
echo "<br>A tömb elemeinek a száma: ".count($tomb);
|
||||
$tomb[] = "szombat";
|
||||
echo "<br>Az utolsó elem: ".$tomb[count($tomb) - 1];
|
||||
echo "Tömb elemének törlése...<br>";
|
||||
unset($tomb[1]);
|
||||
var_dump($tomb);
|
||||
echo "<br>";
|
||||
foreach ($tomb as $elem) {
|
||||
echo $elem. "<br>";
|
||||
}
|
||||
|
||||
// foreach ($_SERVER as $key => $value) {
|
||||
// echo $key. " értéke: ".$value."<br>";
|
||||
// }
|
||||
|
||||
$atomb = array();
|
||||
|
||||
$atomb["elso"] = "matyi";
|
||||
$atomb["masodik"] = "dani";
|
||||
|
||||
echo $atomb["elso"]."<br>";
|
||||
|
||||
foreach ($atomb as $key => $value) {
|
||||
echo $key. " értéke: ".$value."<br>";
|
||||
}
|
||||
|
||||
echo "Név: ".$_GET["nev"]."<br>";
|
||||
echo "Jelszó: ".$_GET["jelszo"]."<br>";
|
||||
echo "Született: ".$_GET["szul"]."<br>";
|
||||
|
||||
|
||||
if ($_GET["nev"] == "Jani")
|
||||
{
|
||||
echo "Belépés engedélyezve Janinak";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
echo "Nincs jogosultság";
|
||||
}
|
||||
|
||||
?>
|
||||
30
Suli/13.b/Backend/2024. 09. 12/harmadik.php
Normal file
30
Suli/13.b/Backend/2024. 09. 12/harmadik.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
$islogin = false;
|
||||
if (isset($_GET["kod"]) && $_GET["kod"] == 1111 ) {
|
||||
echo "Üdvözöllek".$_GET["nev"];
|
||||
$islogin = true;
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>PHP form</title>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
if ($islogin == "false") {
|
||||
?>
|
||||
<form>
|
||||
<input type="text" name="nev" title="Adja meg a nevet"><br>
|
||||
<input type="number" name="kod" min="1000" max="5000" title="Adja meg a kódot"><br>
|
||||
<input type="submit" value="Belépés">
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
8
Suli/13.b/Backend/2024. 09. 16/footer.php
Normal file
8
Suli/13.b/Backend/2024. 09. 16/footer.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
echo '<div style="position: absolute; bottom: 3px; width: 100%;
|
||||
text-align: center; height: 30px; background: black; color: white;">
|
||||
Készítette: Tóth Ádám (c)2024.
|
||||
</div>';
|
||||
|
||||
|
||||
?>
|
||||
0
Suli/13.b/Backend/2024. 09. 16/loginform.php
Normal file
0
Suli/13.b/Backend/2024. 09. 16/loginform.php
Normal file
19
Suli/13.b/Backend/2024. 09. 16/negy.php
Normal file
19
Suli/13.b/Backend/2024. 09. 16/negy.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php require "negy1.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>
|
||||
<form method="POST">
|
||||
<label for="nev">Login: </label><input type="text" id="nev" name="nev" title="Add meg a neved"><br>
|
||||
<label for="jelszo">Jelszó: </label><input type="password" id="jelszo" name="jelszo" title="Jelszó"><br>
|
||||
<button type="submit">Belépés</button>
|
||||
</form>
|
||||
<?php require "footer.php";?>
|
||||
</body>
|
||||
</html>
|
||||
14
Suli/13.b/Backend/2024. 09. 16/negy1.php
Normal file
14
Suli/13.b/Backend/2024. 09. 16/negy1.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
28
Suli/13.b/Backend/2024. 09. 19/ot.php
Normal file
28
Suli/13.b/Backend/2024. 09. 19/ot.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
require "ot1.php"
|
||||
?>
|
||||
|
||||
<!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>
|
||||
<h1>Szöveges</h1>
|
||||
<form action="#" method="POST">
|
||||
<label for="szoveg1"></label>
|
||||
<input type="text" name="szoveg1" id="szoveg1" title="Adj meg egy szöveget"><br>
|
||||
<button type="submit">Hejj</button>
|
||||
</form>
|
||||
<?php
|
||||
if ($vane) {
|
||||
echo "<h2>Szerepel benne az alma szó!</h2>";
|
||||
}
|
||||
else {
|
||||
echo "<h2>Nem szerepel benne az alma szó!</h2>";
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
9
Suli/13.b/Backend/2024. 09. 19/ot1.php
Normal file
9
Suli/13.b/Backend/2024. 09. 19/ot1.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
$vane = false;
|
||||
$szov = $_POST["szoveg1"];
|
||||
if (isset($_POST["szoveg1"]) && strlen["szoveg1"] >= 5) {
|
||||
if (strpos($szov, "alma") != false) {
|
||||
$vane = true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
11
Suli/13.b/Backend/2024. 09. 26/index.php
Normal file
11
Suli/13.b/Backend/2024. 09. 26/index.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="hu">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Játék</title>
|
||||
</head>
|
||||
<body>
|
||||
<?php include "szomegadas_vizsgalas.php" ?>
|
||||
</body>
|
||||
</html>
|
||||
6
Suli/13.b/Backend/2024. 09. 26/szokitalalas.php
Normal file
6
Suli/13.b/Backend/2024. 09. 26/szokitalalas.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<form method="POST">
|
||||
<label for="kitalalas">Találd ki a szót:</label>
|
||||
<input type="text" name="kitalalas" id="kitalalas" maxlength="1"><br>
|
||||
<button type="submit">Adjad be hülyegyerek</button>
|
||||
</form>
|
||||
<?php include "szokitalalas_vizsgalas.php" ?>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
if (isset($_POST["kitalalas"]) && strpos(haystack: $_POST["megadott-szo"], needle: $_POST["kitalalas"])) {
|
||||
echo "KAKAKAKAK";
|
||||
}
|
||||
?>
|
||||
5
Suli/13.b/Backend/2024. 09. 26/szomegadas.php
Normal file
5
Suli/13.b/Backend/2024. 09. 26/szomegadas.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<form method="POST">
|
||||
<label for="megadott-szo">A megadott szó:</label>
|
||||
<input type="text" name="megadott-szo" id="megadott-szo" maxlength="10"><br>
|
||||
<button type="submit">Adjad be hülyegyerek</button>
|
||||
</form>
|
||||
14
Suli/13.b/Backend/2024. 09. 26/szomegadas_vizsgalas.php
Normal file
14
Suli/13.b/Backend/2024. 09. 26/szomegadas_vizsgalas.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
if (!isset($_POST["megadott-szo"])) {
|
||||
include "szomegadas.php";
|
||||
}
|
||||
|
||||
else if (isset($_POST["megadott-szo"]) && strpos(haystack: $_POST["megadott-szo"], needle: ' ')) {
|
||||
include "szomegadas.php";
|
||||
echo "Helytelen szószerkezet!";
|
||||
}
|
||||
|
||||
else {
|
||||
include "szokitalalas.php";
|
||||
}
|
||||
?>
|
||||
33
Suli/13.b/Backend/2024. 10. 10/hat01.php
Normal file
33
Suli/13.b/Backend/2024. 10. 10/hat01.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
session_start();
|
||||
$_SESSION["menet"] = 14;
|
||||
echo $_SESSION["menet"];
|
||||
session_destroy();
|
||||
if (isset($_POST["kilep"]) && $_POST["kilep"] == 1) {
|
||||
unset($_COOKIE["belepve"]);
|
||||
unset($_COOKIE["nev"]);
|
||||
setcookie("belepve", "");
|
||||
setcookie("nev", "");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="hu">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Sütik és munkamenetek</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Bejelentkezés</h1>
|
||||
<form action="hat02.php" method="POST">
|
||||
Név: <input type="text" name="nev"><br>
|
||||
Jelszó: <input type="password" name="jelszo"><br>
|
||||
<button type="submit">Belépés</button>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
24
Suli/13.b/Backend/2024. 10. 10/hat02.php
Normal file
24
Suli/13.b/Backend/2024. 10. 10/hat02.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
if (!isset($_COOKIE["belepve"])) {
|
||||
if (isset($_POST["nev"]) && isset($_POST["jelszo"]) && $_POST["jelszo"] == "kaka") {
|
||||
setcookie("belepve", 1);
|
||||
setcookie("nev", $_POST["nev"]);
|
||||
}
|
||||
|
||||
else {
|
||||
echo "Nincs kitöltve minden mező vagy rossz jelszó...";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (isset($_COOKIE["belepve"])) {
|
||||
echo $_COOKIE["nev"];
|
||||
echo '<form action="hat01.php" method="POST">';
|
||||
echo '<input type="hidden" name="kilep" value="1">';
|
||||
echo '<button type="submit">Kilépés</button>';
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
?>
|
||||
38
Suli/13.b/Backend/2024. 10. 14/func.php
Normal file
38
Suli/13.b/Backend/2024. 10. 14/func.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
function canSubmit(): bool {
|
||||
if (!isset($_POST)) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
if(!isset($_POST["loginname"]) || strlen($_POST["loginname"])) {
|
||||
return false;
|
||||
}
|
||||
else if (!isset($_POST["pwd"])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function checkLogin(): bool {
|
||||
$jologinname = "user";
|
||||
$jopwd = "alma";
|
||||
|
||||
if (isset($_POST["loginname"]) && $_POST["loginname"] == $jologinname && $_POST["pwd"] == $jopwd) {
|
||||
$_SESSION["user"] = 1;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function isLoggedin() {
|
||||
if (isset($_SESSION["user"])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
32
Suli/13.b/Backend/2024. 10. 14/index.php
Normal file
32
Suli/13.b/Backend/2024. 10. 14/index.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
session_start();
|
||||
include("func.php");
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="hu">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Munkamenet</title>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
canSubmit();
|
||||
checkLogin();
|
||||
if (isLoggedin()) {
|
||||
echo "Sikeres bejelentkezés";
|
||||
|
||||
}
|
||||
else { ?>
|
||||
<h1>Bejelentkezés</h1>
|
||||
<form action="#" method="POST">
|
||||
Név: <input type="text" name="loginname"><br>
|
||||
Jelszó: <input type="password" name="pwd"><br>
|
||||
<button type="submit">Bejelentkezés</button>
|
||||
</form>
|
||||
<?php } ?>
|
||||
</body>
|
||||
</html>
|
||||
25
Suli/13.b/Backend/2024. 10. 17/func.php
Normal file
25
Suli/13.b/Backend/2024. 10. 17/func.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
function check_post() {
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
$_SESSION["num1"] = $_POST["num1"];
|
||||
$_SESSION["num2"] = $_POST["num2"];
|
||||
$num1 = $_SESSION["num1"];
|
||||
$num2 = $_SESSION["num2"];
|
||||
|
||||
if ($num1 > 0 && $num2 > 0) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function add($szam1, $szam2) {
|
||||
return $szam1 + $szam2;
|
||||
}
|
||||
|
||||
?>
|
||||
15
Suli/13.b/Backend/2024. 10. 17/html.php
Normal file
15
Suli/13.b/Backend/2024. 10. 17/html.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="hu">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Fügvények</title>
|
||||
</head>
|
||||
<body>
|
||||
<form method="POST">
|
||||
<input type="number" name="num1" id="num1"> +
|
||||
<input type="number" name="num2" id="num2">
|
||||
<button type="submit">Összead</button>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
8
Suli/13.b/Backend/2024. 10. 17/nyolc.php
Normal file
8
Suli/13.b/Backend/2024. 10. 17/nyolc.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
session_start();
|
||||
include("func.php");
|
||||
if (check_post()) {
|
||||
echo add(szam1: $_SESSION["num1"], szam2: $_SESSION["num2"]);
|
||||
}
|
||||
include("html.php");
|
||||
?>
|
||||
56
Suli/13.b/Backend/2024. 10. 24/head.php
Normal file
56
Suli/13.b/Backend/2024. 10. 24/head.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
session_start();
|
||||
$celkonyvtar = "kepek/";
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
if (!is_dir($celkonyvtar)) {
|
||||
mkdir($celkonyvtar);
|
||||
}
|
||||
|
||||
$uname = uniqid();
|
||||
$celfajl = $celkonyvtar.$_FILES["kepfajl"]["name"];
|
||||
|
||||
$maxmeret = 5 * 1024 * 1024;
|
||||
$kepkiterjesztes = strtolower(pathinfo($celfajl, PATHINFO_EXTENSION));
|
||||
$uploadOK = 1;
|
||||
|
||||
if (getimagesize($_FILES["kepfajl"]["tmp_name"]) == false) {
|
||||
$uploadOK = 0;
|
||||
echo "Nem kép lett megadva!";
|
||||
}
|
||||
|
||||
if ($_FILES["kepfajl"]["size"] > $maxmeret) {
|
||||
$uploadOK = 0;
|
||||
echo "Túl nagy állomány!";
|
||||
}
|
||||
|
||||
if ($kepkiterjesztes != "jpg" && $kepkiterjesztes != "png") {
|
||||
$uploadOK = 0;
|
||||
echo "Nem megengedett képformátum";
|
||||
}
|
||||
|
||||
if ($uploadOK == 1) {
|
||||
$vanmar = 0;
|
||||
if (file_exists($celfajl)) {
|
||||
$vanmar = 1;
|
||||
}
|
||||
|
||||
if (move_uploaded_file($_FILES["kepfajl"]["tmp_name"], $celfajl) == true) {
|
||||
if ($vanmar == 0) {
|
||||
$_SESSION["kepek"][] = $celfajl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$kepek = glob($celkonyvtar."*");
|
||||
|
||||
foreach ($kepek as $img) {
|
||||
echo '<img src="'.$img.'" style="width: 200px; height: auto">';
|
||||
}
|
||||
|
||||
// if (isset($_SESSION["kepek"])) {
|
||||
// foreach ($_SESSION["kepek"] as $value) {
|
||||
// echo '<img src="'.$value.'" style="width: 200px; height: auto;">';
|
||||
// }
|
||||
// }
|
||||
?>
|
||||
21
Suli/13.b/Backend/2024. 10. 24/html.php
Normal file
21
Suli/13.b/Backend/2024. 10. 24/html.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
include("head.php");
|
||||
?>
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="hu">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Képek feltöltése PHP-val</h1>
|
||||
<form action="#" method="POST" enctype="multipart/form-data">
|
||||
Név: <input type="text" name="kepnev"><br>
|
||||
<input type="file" name="kepfajl"><br>
|
||||
<button type="submit">Feltölt</button>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
BIN
Suli/13.b/Backend/2024. 10. 24/kepek/red_panda.jpg
Normal file
BIN
Suli/13.b/Backend/2024. 10. 24/kepek/red_panda.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
BIN
Suli/13.b/Backend/Dolgozat_2024. 10. 21.zip
Normal file
BIN
Suli/13.b/Backend/Dolgozat_2024. 10. 21.zip
Normal file
Binary file not shown.
10
Suli/13.b/Backend/Dolgozat_2024. 10. 21/bejelentkezes.php
Normal file
10
Suli/13.b/Backend/Dolgozat_2024. 10. 21/bejelentkezes.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (isset($_POST["nev"]) && $_POST["nev"] == "vasarlo" && isset($_POST["jelszo"]) && $_POST["jelszo"] == "jelszo" && !isset($_SESSION["nev"])) {
|
||||
$_SESSION["nev"] = $_POST["nev"];
|
||||
header(header: "Location: termekek.php");
|
||||
}
|
||||
else {
|
||||
header(header: "Location: form.php");
|
||||
}
|
||||
?>
|
||||
12
Suli/13.b/Backend/Dolgozat_2024. 10. 21/css/style.css
Normal file
12
Suli/13.b/Backend/Dolgozat_2024. 10. 21/css/style.css
Normal file
@@ -0,0 +1,12 @@
|
||||
body {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 100vh;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
21
Suli/13.b/Backend/Dolgozat_2024. 10. 21/form.php
Normal file
21
Suli/13.b/Backend/Dolgozat_2024. 10. 21/form.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="hu">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Bejelentkezés</title>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
session_start();
|
||||
if (isset($_SESSION["nev"])) {
|
||||
header(header: "Location: termekek.php");
|
||||
}
|
||||
?>
|
||||
<form action="bejelentkezes.php" method="POST">
|
||||
<label for="nev">Név: </label><input type="text" name="nev" id="nev"><br>
|
||||
<label for="jelszo">Jelszó: </label><input type="password" name="jelszo" id="jelszo"><br>
|
||||
<button type="submit">Bejelentkezés</button>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
BIN
Suli/13.b/Backend/Dolgozat_2024. 10. 21/img/baranyhus.png
Normal file
BIN
Suli/13.b/Backend/Dolgozat_2024. 10. 21/img/baranyhus.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
BIN
Suli/13.b/Backend/Dolgozat_2024. 10. 21/img/ribeye.png
Normal file
BIN
Suli/13.b/Backend/Dolgozat_2024. 10. 21/img/ribeye.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
BIN
Suli/13.b/Backend/Dolgozat_2024. 10. 21/img/tbone.png
Normal file
BIN
Suli/13.b/Backend/Dolgozat_2024. 10. 21/img/tbone.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
14
Suli/13.b/Backend/Dolgozat_2024. 10. 21/kiertekeles.php
Normal file
14
Suli/13.b/Backend/Dolgozat_2024. 10. 21/kiertekeles.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
function kiertekeles() {
|
||||
if (!isset($_POST["kg1"]) || !isset($_POST["kg2"]) || !isset($_POST["kg3"])) {
|
||||
echo "Nem adtál meg minden értéket!";
|
||||
}
|
||||
else {
|
||||
$baranyhus = 7900;
|
||||
$tbone = 7500;
|
||||
$ribeye = 6500;
|
||||
|
||||
echo "Megrendelését rögzítettük, fizetendő összeg: ".$baranyhus * $_POST["kg1"] + $tbone * $_POST["kg2"] + $ribeye * $_POST["kg3"]." Ft";
|
||||
}
|
||||
}
|
||||
?>
|
||||
10
Suli/13.b/Backend/Dolgozat_2024. 10. 21/kijelentkezes.php
Normal file
10
Suli/13.b/Backend/Dolgozat_2024. 10. 21/kijelentkezes.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (isset($_SESSION["nev"])) {
|
||||
unset($_SESSION["nev"]);
|
||||
header(header: "Location: form.php");
|
||||
}
|
||||
else {
|
||||
header(header: "Location: form.php");
|
||||
}
|
||||
?>
|
||||
44
Suli/13.b/Backend/Dolgozat_2024. 10. 21/termekek.php
Normal file
44
Suli/13.b/Backend/Dolgozat_2024. 10. 21/termekek.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="hu">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
session_start();
|
||||
if (!isset($_SESSION["nev"])) {
|
||||
header(header: "Location: form.php");
|
||||
}
|
||||
?>
|
||||
<h1>Vásárlás</h1>
|
||||
<form class="container" action="#" method="POST">
|
||||
<div class="termek">
|
||||
<img src="img/baranyhus.png" alt=""><br>
|
||||
<p>Bárány hátsó csülök</p>
|
||||
<p>7900 Ft/kg</p>
|
||||
<input type="number" name="kg1" id="kg1" value="0">
|
||||
</div>
|
||||
<div class="termek">
|
||||
<img src="img/tbone.png" alt=""><br>
|
||||
<p>T-bone steak</p>
|
||||
<p>7500 Ft/kg</p>
|
||||
<input type="number" name="kg2" id="kg2" value="0">
|
||||
</div>
|
||||
<div class="termek">
|
||||
<img src="img/ribeye.png" alt=""><br>
|
||||
<p>Ribeye steak</p>
|
||||
<p>6500 Ft/kg</p>
|
||||
<input type="number" name="kg3" id="kg3" value="0">
|
||||
</div><br>
|
||||
<button type="submit">Vásárlás</button>
|
||||
</form>
|
||||
<a href="kijelentkezes.php">Kijelentkezés</a>
|
||||
<?php
|
||||
include "kiertekeles.php";
|
||||
kiertekeles();
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
19
Suli/13.b/Backend/Fölki/DogaGyak_2024. 09. 19/index.php
Normal file
19
Suli/13.b/Backend/Fölki/DogaGyak_2024. 09. 19/index.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php require "index1.php"; ?>
|
||||
<!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
|
||||
if ($islogin == false) {
|
||||
require "login.php";
|
||||
}
|
||||
else {
|
||||
require "logged.php";
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
9
Suli/13.b/Backend/Fölki/DogaGyak_2024. 09. 19/index1.php
Normal file
9
Suli/13.b/Backend/Fölki/DogaGyak_2024. 09. 19/index1.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
$islogin = false;
|
||||
|
||||
if (isset($_POST["nev"]) && isset($_POST["jelszo"])) {
|
||||
if ($_POST["jelszo"] == "admin") {
|
||||
$islogin = true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
1
Suli/13.b/Backend/Fölki/DogaGyak_2024. 09. 19/logged.php
Normal file
1
Suli/13.b/Backend/Fölki/DogaGyak_2024. 09. 19/logged.php
Normal file
@@ -0,0 +1 @@
|
||||
<h1>Üdvözöllek, <?php $_POST["nev"]?></h1>
|
||||
7
Suli/13.b/Backend/Fölki/DogaGyak_2024. 09. 19/login.php
Normal file
7
Suli/13.b/Backend/Fölki/DogaGyak_2024. 09. 19/login.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<form method="POST">
|
||||
<label for="nev">Név</label>
|
||||
<input type="text" name="nev" id="nev"><br>
|
||||
<label for="jelszo">Jelszó</label>
|
||||
<input type="password" name="jelszo" id="jelszo"><br>
|
||||
<button type="submit">SUBMITTTTT</button>
|
||||
</form>
|
||||
34
Suli/13.b/Backend/Fölki/elso.php
Normal file
34
Suli/13.b/Backend/Fölki/elso.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
$kiirando = 'Éljen a PHP<br>';
|
||||
echo $kiirando;
|
||||
$kiirando = "It's PHP<br>";
|
||||
echo $kiirando;
|
||||
$kiirando = 12;
|
||||
echo $kiirando*3;
|
||||
|
||||
// phpinfo();
|
||||
/*
|
||||
$html = '<html>
|
||||
<head>
|
||||
<title>PHP-s html</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Ez cím</h1>
|
||||
<p>Blah blah blah</p>
|
||||
</body>
|
||||
</html>';
|
||||
|
||||
echo $html;
|
||||
*/
|
||||
$cim = "Most más a cím";
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<title>PHP-s html</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1><?php echo $cim; ?></h1>
|
||||
<p>Blah blah blah</p>
|
||||
<?php var_dump($kiirando); ?>
|
||||
</body>
|
||||
</html>
|
||||
54
Suli/13.b/Backend/Fölki/harmadik.php
Normal file
54
Suli/13.b/Backend/Fölki/harmadik.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
$method = "POST";
|
||||
$islogin = false;
|
||||
/* if (isset($_GET["kod"]) && $_GET["kod"]==1111)
|
||||
{
|
||||
$islogin = true;
|
||||
}
|
||||
*/
|
||||
if (isset($_POST["kod"]))
|
||||
switch ($_POST["kod"])
|
||||
{
|
||||
case 1111:
|
||||
case 2222:
|
||||
case 3333:
|
||||
case 4444:
|
||||
$islogin = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
$islogin = false;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="hu">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>PHP form</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php if ($islogin==false)
|
||||
{ ?>
|
||||
<form method="<?php echo $method; ?>">
|
||||
<input type="text" name="nev" title="Adja meg a nevet"><br>
|
||||
<input type="number" name="kod" min=1000 max=9999 title="Adja meg a kódot"><br>
|
||||
<input type="submit" value="Belépés">
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<h1>Üdvözöllek ".$_POST["nev"]."</h1>";
|
||||
echo "<a href='harmadik.php'>Kijelentkezés</a>";
|
||||
}
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
53
Suli/13.b/Backend/Fölki/masodik.php
Normal file
53
Suli/13.b/Backend/Fölki/masodik.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
define("KONSTVER","v20240909");
|
||||
|
||||
echo KONSTVER;
|
||||
echo "<br>";
|
||||
|
||||
$tomb = array("hétfő","kedd","szerda","csütörtök","péntek");
|
||||
|
||||
var_dump($tomb);
|
||||
|
||||
echo "<br>Az első elem a tömbben: ".$tomb[0];
|
||||
echo "<br>A tömb elemeinek a száma: ".count($tomb);
|
||||
$tomb[] = "szombat";
|
||||
echo "<br>Az utolsó elem: ".$tomb[count($tomb)-1];
|
||||
echo "Tömb elemének a törlése...<br>";
|
||||
unset($tomb[1]);
|
||||
var_dump($tomb);
|
||||
echo "<br>";
|
||||
foreach ($tomb as $egyelem) {
|
||||
echo $egyelem."<br/>";
|
||||
}
|
||||
|
||||
foreach ($_SERVER as $key => $value) {
|
||||
echo $key." értéke: ".$value."<br>";
|
||||
|
||||
}
|
||||
|
||||
echo "Asszociatív tömb:<br>";
|
||||
|
||||
$atomb = array();
|
||||
|
||||
$atomb["elso"] = "matyi";
|
||||
$atomb["masodik"] = "dani";
|
||||
|
||||
echo $atomb["elso"]."<br>";
|
||||
|
||||
foreach ($atomb as $kulcs => $ertek) {
|
||||
echo $kulcs." értéke: ".$ertek."<br>";
|
||||
}
|
||||
|
||||
echo "Név: ".$_GET["nev"]."<br>";
|
||||
echo "Jelszó: ".$_GET["jelszo"]."<br>";
|
||||
echo "Született: ".$_GET["szul"]."<br>";
|
||||
|
||||
if ($_GET["nev"]=="Jani")
|
||||
{
|
||||
echo "Belépés engedélyezve Janinak";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Nincs jogosultság";
|
||||
}
|
||||
?>
|
||||
8
Suli/13.b/Backend/Fölki/negy/footer.php
Normal file
8
Suli/13.b/Backend/Fölki/negy/footer.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
echo '<div style="position: absolute; bottom: 3px; width: 100%;
|
||||
text-align: center; height: 30px; background: black; color: white;">
|
||||
Készítette: Fölker Csaba (c)2024.
|
||||
</div>';
|
||||
|
||||
|
||||
?>
|
||||
2
Suli/13.b/Backend/Fölki/negy/logged.php
Normal file
2
Suli/13.b/Backend/Fölki/negy/logged.php
Normal file
@@ -0,0 +1,2 @@
|
||||
<h3>Üdvözöllek <?php echo $nev; ?></h3>
|
||||
<a href="negy.php">Kijelentkezés</a>
|
||||
5
Suli/13.b/Backend/Fölki/negy/loginform.php
Normal file
5
Suli/13.b/Backend/Fölki/negy/loginform.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<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>
|
||||
21
Suli/13.b/Backend/Fölki/negy/negy.php
Normal file
21
Suli/13.b/Backend/Fölki/negy/negy.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php require 'negy1.php'; ?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="hu">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Alap web valami</title>
|
||||
</head>
|
||||
<body>
|
||||
<?php require 'footer.php'; ?>
|
||||
<h1>POST használata </h1>
|
||||
<?php
|
||||
if ($islogin==false)
|
||||
require 'loginform.php';
|
||||
else
|
||||
require 'logged.php';
|
||||
?>
|
||||
<?php require 'footer.php'; ?>
|
||||
</body>
|
||||
</html>
|
||||
16
Suli/13.b/Backend/Fölki/negy/negy1.php
Normal file
16
Suli/13.b/Backend/Fölki/negy/negy1.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
BIN
Suli/13.b/Backend/Tóth Ádám_Feladat.zip
Normal file
BIN
Suli/13.b/Backend/Tóth Ádám_Feladat.zip
Normal file
Binary file not shown.
BIN
Suli/13.b/Backend/Órai feladat_2024. 10. 15.zip
Normal file
BIN
Suli/13.b/Backend/Órai feladat_2024. 10. 15.zip
Normal file
Binary file not shown.
25
Suli/13.b/Backend/Órai feladat_2024. 10. 15/login.php
Normal file
25
Suli/13.b/Backend/Órai feladat_2024. 10. 15/login.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
if (isset($_SESSION["user"])) {
|
||||
header(header: "Location: profile.php");
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="hu">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Bejelentkezés</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Bejelentkezés</h1>
|
||||
<form action="profile.php" method="POST">
|
||||
<label for="nev">Név: </label><input type="text" name="nev" id="nev"><br>
|
||||
<label for="jelszo">Jelszó: </label><input type="password" name="jelszo" id="jelszo"><br>
|
||||
<input type="color" name="szin" id="szin"><br>
|
||||
<button type="submit">Bejelentkezés</button>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
6
Suli/13.b/Backend/Órai feladat_2024. 10. 15/logout.php
Normal file
6
Suli/13.b/Backend/Órai feladat_2024. 10. 15/logout.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
session_start();
|
||||
unset($_SESSION["user"]);
|
||||
setcookie("szin", "", time() - 3600);
|
||||
header(header: "Location: login.php");
|
||||
?>
|
||||
38
Suli/13.b/Backend/Órai feladat_2024. 10. 15/profile.php
Normal file
38
Suli/13.b/Backend/Órai feladat_2024. 10. 15/profile.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
if (isset($_POST["nev"]) && !isset($_SESSION["user"])) {
|
||||
$_SESSION["user"] = $_POST["nev"];
|
||||
setcookie("szin", $_POST["szin"], time() + (60 * 60 * 24));
|
||||
$szin = $_POST["szin"];
|
||||
}
|
||||
else if ($_SESSION["user"]) {
|
||||
$szin = $_COOKIE["szin"];
|
||||
}
|
||||
else {
|
||||
header(header: "Location: login.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="hu">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Profil</title>
|
||||
<style>
|
||||
body {
|
||||
background-color: <?php echo $szin ?>;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
echo "Név: ". $_SESSION["user"]. "<br>";
|
||||
echo "Választott szín: ". $szin;
|
||||
?>
|
||||
<br><a href="logout.php">Kijelentkezés</a>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user