added orai

This commit is contained in:
szabomarton 2024-12-05 11:59:42 +01:00
parent 350f937b4f
commit 0158b59ccb
6 changed files with 66 additions and 0 deletions

22
20241205/config.php Normal file
View File

@ -0,0 +1,22 @@
<?php
$server = "localhost";
$user = "root";
$pwd = "";
$db = "guest13b";
$conn = new mysqli($server,$user,$pwd,$db);
if ($conn->connect_errno)
{
die("Nem sikerült a kapcsolat kiépítése: ".$conn->connect_error);
}
$sql = "SELECT * FROM felh";
$result = $conn->query($sql);
if($result->num_rows){
echo "Van rekord";
}
?>

3
20241205/footer.php Normal file
View File

@ -0,0 +1,3 @@
</body>
</html>
<?php $conn->close();?>

10
20241205/func.php Normal file
View File

@ -0,0 +1,10 @@
<?php
$title = "Cím";
$_SESSION["nev"] = "Vendég József";
$_SESSION["id"] = 9999;
$_SESSION["islogin"] = false;
if(isset($_POST["uzenet"])){
echo "Az üzeneted: ".$_POST["uzenet"];
}

13
20241205/head.php Normal file
View File

@ -0,0 +1,13 @@
<!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>
<?php
echo $title;
?>
</h1>

11
20241205/html.php Normal file
View File

@ -0,0 +1,11 @@
<p>Teszt felület vendég</p>
<form action="#" method="POST">
<label for="name">Név: </label>
<input type="text" name="name" required><br>
<label for="email">Email: </label>
<input type="email" name="email" required><br>
<label for="uzenet">Üzenet: </label>
<textarea name="uzenet" rows="10" cols="50" required></textarea>
<button type="submit">Beküldés</button>
</form>

7
20241205/index.php Normal file
View File

@ -0,0 +1,7 @@
<?php
session_start();
require_once("config.php");
require_once("func.php");
require_once("head.php");
require_once("html.php");
require_once("footer.php");