added doga
This commit is contained in:
parent
829ee5c982
commit
1c13613074
59
20241021/checkout.php
Normal file
59
20241021/checkout.php
Normal file
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
session_start();
|
||||
|
||||
if(isset($_POST["skull"]) && isset($_POST["langos"]) && isset($_POST["bicikli"])){
|
||||
if($_POST["skull"] == ""){
|
||||
$_SESSION["skull"] = 0;
|
||||
} else {
|
||||
$_SESSION["skull"] = $_POST["skull"];
|
||||
}
|
||||
|
||||
if($_POST["langos"] == ""){
|
||||
$_SESSION["langos"] = 0;
|
||||
|
||||
} else {
|
||||
$_SESSION["langos"] = $_POST["langos"];
|
||||
}
|
||||
|
||||
if($_POST["bicikli"] == ""){
|
||||
$_SESSION["bicikli"] = 0;
|
||||
} else {
|
||||
$_SESSION["bicikli"] = $_POST["bicikli"];
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<!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 "Fizetendő összeg: ";
|
||||
echo $_SESSION["skull"] * 5000 + $_SESSION["langos"] * 2500 + $_SESSION["bicikli"] * 50000;
|
||||
echo " Ft";
|
||||
?>
|
||||
<!--
|
||||
<p>Vásárolt termékek:</p>
|
||||
-->
|
||||
<?php
|
||||
/*
|
||||
if($_SESSION["skull" != 0]){
|
||||
echo "Koponya: ".$_SESSION["skull"]."db";
|
||||
}
|
||||
*/
|
||||
?>
|
||||
<form action="index.php" method="POST">
|
||||
<input type="hidden" name="logout" value="1">
|
||||
<button type="submit">
|
||||
Kijelentkezés
|
||||
</button>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
BIN
20241021/images/bicikli.jpg
Normal file
BIN
20241021/images/bicikli.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 116 KiB |
BIN
20241021/images/langos.jpg
Normal file
BIN
20241021/images/langos.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.0 MiB |
BIN
20241021/images/skull_1.jpg
Normal file
BIN
20241021/images/skull_1.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 48 KiB |
29
20241021/index.php
Normal file
29
20241021/index.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
session_start();
|
||||
if (isset($_POST["logout"]) && $_POST["logout"] == 1){
|
||||
unset($_SESSION["username"]);
|
||||
unset($_SESSION["password"]);
|
||||
|
||||
session_destroy();
|
||||
$_POST["logout"] = 0;
|
||||
} else if (isset($_SESSION["username"]) && isset($_SESSION["password"])){
|
||||
header("Location: main.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>
|
||||
<form action="termekek.php" method="POST">
|
||||
Név: <input type="text" name="username"> <br>
|
||||
Jelszó: <input type="password" name="password"> <br>
|
||||
<button type="submit">Bejelentkezés</button>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
19
20241021/main.php
Normal file
19
20241021/main.php
Normal file
|
@ -0,0 +1,19 @@
|
|||
<?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>
|
||||
<form action="index.php" method="POST">
|
||||
<input type="hidden" name="logout" value="1">
|
||||
<button type="submit">
|
||||
Kijelentkezés
|
||||
</button>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
25
20241021/redirected.php
Normal file
25
20241021/redirected.php
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?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
|
||||
|
||||
$_SESSION["username"] = $_POST["username"];
|
||||
$_SESSION["password"] = $_POST["password"];
|
||||
|
||||
if ($_SESSION["username"] == "vasarlo" && $_SESSION["password"] == "jelszo") {
|
||||
include("termekek.php");
|
||||
} else {
|
||||
include("main.php");
|
||||
}
|
||||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
BIN
20241021/szabomarton_dolgozat.zip
Normal file
BIN
20241021/szabomarton_dolgozat.zip
Normal file
Binary file not shown.
53
20241021/termekek.php
Normal file
53
20241021/termekek.php
Normal file
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
session_start();
|
||||
?>
|
||||
<?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>Retek bolt</h1>
|
||||
|
||||
<form action="checkout.php" method="POST">
|
||||
<h2>My movie metal skull gearshift</h2>
|
||||
<h3>5000 Ft / db</h3>
|
||||
<img src="images/skull_1.jpg" alt="skull" width="500px">
|
||||
|
||||
<input type="number" name="skull">
|
||||
|
||||
|
||||
<h2>Eskü finom lángos</h2>
|
||||
<h3>2500 Ft / db</h3>
|
||||
<img src="images/langos.jpg" alt="langos" width="500px">
|
||||
|
||||
<input type="number" name="langos">
|
||||
|
||||
|
||||
|
||||
<h2>Bicaj a gyereknek</h2>
|
||||
<h3>50000 Ft / db</h3>
|
||||
<img src="images/bicikli.jpg" alt="bicikli" width="500px">
|
||||
|
||||
<input type="number" name="bicikli">
|
||||
|
||||
<button type="submit">Vásárlás befejezése</button>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
<form action="index.php" method="POST">
|
||||
<input type="hidden" name="logout" value="1">
|
||||
<button type="submit">
|
||||
Kijelentkezés
|
||||
</button>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user