Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if( !isset($_GET["page"])) {
- $_GET["page"] = 'kezdolap';
- }
- ?>
- <!DOCTYPE html>
- <html lang="hu">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
- <title>Gombóc Artúr csokiraktára</title>
- <!-- Bootstrap -->
- <link href="css/bootstrap.min.css" rel="stylesheet">
- <link href="css/artur_style.css" rel="stylesheet">
- </head>
- <body>
- <div id="artur_container">
- <div id="artur_header" class="artur_Header">
- <!-- A fejléc -->
- <h1>Gombóc Artúr csokiraktára</h1>
- <div id="artur_menu">
- <ul class="nav nav-tabs">
- <li role="presentation" <?php if($_GET["page"]=="kezdolap"){?> class="active"<?php } ?>><a href="index.php?page=kezdolap">Home</a></li>
- <li role="presentation" <?php if($_GET["page"]=="csokikereses"){?> class="active"<?php } ?>><a href="index.php?page=csokikereses">Csoki keresése</a></li>
- <li role="presentation" <?php if($_GET["page"]=="csoki"){?> class="active"<?php } ?>><a href="index.php?page=csoki">Csokoládék</a></li>
- </ul>
- </div>
- </div>
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "";
- // Kapcsolat felépítése
- $conn = new mysqli($servername, $username, $password);
- // Ellenőrzés
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- // Megfelelő karakterkódolás
- mysqli_query($conn, "set character_set_results='utf8'");
- mysqli_query($conn, "SET NAMES UTF8");
- // Database kiválasztása
- mysqli_select_db($conn, "gombocartur");
- // A paraméter egy sql lekérdezést tartalmaz
- function my_connect($sql) {
- global $conn;
- //Lekérdezés
- $result = mysqli_query($conn, $sql);
- if($result == FALSE) {
- echo mysqli_error($conn);
- }
- return $result;
- }
- //Megfelelő oldal beillesztése (Menü)
- include $_GET["page"].'.php';
- //Kapcsolat lezárása
- $conn->close();
- ?>
- <div id="artur_footer">
- <!-- A lábléc -->
- <h5>Készítette: Csókási Marcell</h5>
- <h5>Gyakorlat vezető: Horváth Kristóf</h5>
- </div>
- <br style="clear:both" />
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement