Advertisement
Guest User

Untitled

a guest
May 14th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.36 KB | None | 0 0
  1. <?php if( !isset($_GET["page"])) {
  2.     $_GET["page"] = 'kezdolap';
  3. }
  4.    
  5. ?>
  6.  
  7. <!DOCTYPE html>
  8. <html lang="hu">
  9.   <head>
  10.     <meta charset="utf-8">
  11.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  12.     <meta name="viewport" content="width=device-width, initial-scale=1">
  13.     <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
  14.     <title>Gombóc Artúr csokiraktára</title>
  15.  
  16.     <!-- Bootstrap -->
  17.     <link href="css/bootstrap.min.css" rel="stylesheet">
  18.     <link href="css/artur_style.css" rel="stylesheet">
  19.  
  20.   </head>
  21.   <body>
  22.         <div id="artur_container">
  23.         <div id="artur_header" class="artur_Header">
  24.         <!-- A fejléc -->         
  25.             <h1>Gombóc Artúr csokiraktára</h1>                  
  26.             <div id="artur_menu">
  27.                 <ul class="nav nav-tabs">
  28.                     <li role="presentation" <?php if($_GET["page"]=="kezdolap"){?> class="active"<?php } ?>><a href="index.php?page=kezdolap">Home</a></li>
  29.                     <li role="presentation" <?php if($_GET["page"]=="csokikereses"){?> class="active"<?php } ?>><a href="index.php?page=csokikereses">Csoki keresése</a></li>
  30.                     <li role="presentation" <?php if($_GET["page"]=="csoki"){?> class="active"<?php } ?>><a href="index.php?page=csoki">Csokoládék</a></li>
  31.                 </ul>
  32.             </div>                     
  33.         </div>
  34.        
  35.        
  36. <?php  
  37.     $servername = "localhost";
  38.     $username = "root";
  39.     $password = "";
  40.  
  41.     // Kapcsolat felépítése
  42.     $conn = new mysqli($servername, $username, $password);
  43.            
  44.     // Ellenőrzés
  45.     if ($conn->connect_error) {
  46.         die("Connection failed: " . $conn->connect_error);
  47.     }
  48.                
  49.     // Megfelelő karakterkódolás
  50.     mysqli_query($conn, "set character_set_results='utf8'");
  51.         mysqli_query($conn, "SET NAMES UTF8");
  52.    
  53.     // Database kiválasztása
  54.     mysqli_select_db($conn, "gombocartur");
  55.    
  56.     // A paraméter egy sql lekérdezést tartalmaz
  57.     function my_connect($sql) {
  58.         global $conn;      
  59.                    
  60.         //Lekérdezés
  61.         $result = mysqli_query($conn, $sql);
  62.         if($result == FALSE) {                 
  63.             echo mysqli_error($conn);
  64.         }
  65.  
  66.         return $result;
  67.     }
  68.        
  69.         //Megfelelő oldal beillesztése (Menü)
  70.         include $_GET["page"].'.php';
  71.        
  72.     //Kapcsolat lezárása
  73.     $conn->close();
  74.    
  75. ?>
  76.  
  77.         <div id="artur_footer">
  78.         <!-- A lábléc -->
  79.             <h5>Készítette: Csókási Marcell</h5>
  80.             <h5>Gyakorlat vezető: Horváth Kristóf</h5>
  81.         </div>
  82.     <br style="clear:both" />
  83.     </div>     
  84.  
  85.   </body>
  86. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement