Advertisement
okbrcz

Untitled

Apr 10th, 2017
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. <!DOCTYPE HTML>
  2. <html>
  3. <html lang="pl">
  4. <head>
  5. <meta charset="utf-8">
  6.  
  7. <meta name="description" content="Zarządzanie treścią na żywo - CMS">
  8. <meta name="author" content="Oskar Barcz 2017">
  9. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  10. <meta name="viewport" content="width=device-width, initial-scale=1">
  11.  
  12. <title> Logowanie do systemu CMS </title>
  13.  
  14. <link rel="stylesheet" type="text/css" href="style.css">
  15. <link href="https://fonts.googleapis.com/css?family=PT+Sans" rel="stylesheet">
  16.  
  17. </head>
  18. <body>
  19. <?php
  20.  
  21. $servername = "localhost";
  22. $username = "root";
  23. $password = "";
  24.  
  25. // Create connection
  26. $conn = mysqli_connect($servername, $username, $password);
  27.  
  28. // Check connection
  29. if (mysqli_connect_error())
  30. {
  31.  die("Connection failed: " . mysqli_connect_error());
  32. }
  33. mysqli_query($conn, "SET CHARSET utf8");
  34. mysqli_query($conn, "SET NAMES 'utf8' COLLATE 'utf8_polish_ci'");
  35.  
  36. $rezultat=mysqli_query($conn, "SELECT * FROM 'wyniki'");
  37.  
  38. $row = mysqli_fetch_assoc($rezultat);
  39.  
  40. $team1 = $row['druzyna1'];
  41. $pkt1 = $row['punkty1'];
  42. $team2 = $row['druzyna2'];
  43. $pkt2 = $row['punkty2'];
  44.  
  45. $login = $_POST["login"];
  46. $haslo = $_POST["haslo"];
  47.  
  48. if (($login == "admin")&&($haslo == "admin1"))
  49. {
  50. echo
  51. '<div class="siatka">
  52. <div id="leftmenu" class="siatka">
  53.  
  54. </div>
  55. <div id="middlemenu" class="siatka">
  56. <span id="tytul">Aktualny mecz</br>
  57. <input type="textbox" id="druzyna" placeholder="'. $team1 .'"></input> &rarr; <input type="textbox" id="pkt" placeholder="'. $pkt1 .'"></input> : <input type="textbox" id="pkt"placeholder="'. $pkt2 .'"></input> &larr; <input type="textbox" id="druzyna"placeholder="'. $team2 .'"></input></span></br>
  58. <input type="button" value="Pobierz aktualne" style=" margin-right: 10px;"></input>
  59. <input type="button" value="Aktualizuj" style="margin-left=10px; margin-right: 10px;"></input></input>
  60.  
  61. </div>
  62. <div id="rightmenu" class="siatka">
  63. DIV3 '.'
  64. </div>
  65. <div style="clear:both;"></div>
  66.  
  67. </div>';
  68.  
  69.  
  70. }
  71. else echo "<div class='container'>
  72. <div class='login'>
  73. <span id='tytul'>Błąd logowania</span></br></br>
  74. Prawdopodobnie źle wpisałeś login lub hasło. </br></br>
  75. <input type='button' onclick='window.location.href='.php'' value='Powrót do logowania' ></button>
  76. </div>";
  77. echo "MySQL Error: " . mysqli_error();
  78. ?>
  79. </body>
  80. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement