Facebook
From Oskar, 3 Years ago, written in HTML5.
Embed
Download Paste or View Raw
Hits: 85
  1.  
  2.     <meta charset="utf-8">
  3.     <link rel="stylesheet" href="./style.css">
  4. </head>
  5.  
  6.  
  7.     <h1>LISTA OBECNOŚCI</h1>
  8.     <center>
  9.         <form action="./config.php " method="POST ">
  10.             <table>
  11.                 <tr>
  12.                     <td>
  13.                         <label for="imie">Imię</label><br>
  14.                         <input type="text " id="imie" name="imie " placeholder="Wpisz tu imie... " required style="background-color: rgb(0, 255, 255); font-family: Arial, Helvetica, sans-serif; "></td>
  15.                 </tr>
  16.                 <tr></tr><br>
  17.                 <tr>
  18.                     <td>
  19.                         <label for="nazwisko">Nazwisko</label><br>
  20.                         <input type="text " id="nazwisko" name="nazwisko " placeholder="Wpisz tu nazwisko... " required style="background-color: rgb(0, 255, 255); font-family: Arial, Helvetica, sans-serif; "></td>
  21.                 </tr>
  22.                 <tr>
  23.                     <tr>
  24.                         <tr>
  25.                             <td>
  26.                                 <label for="accept">AKCEPTUJE</label><input id="check" type="checkbox" value="tak" placeholder="tak" required></td>
  27.  
  28.                             </td>
  29.                             <br><br>
  30.                         </tr>
  31.                     </tr>
  32.                     <td><button type="submit" id="button1">Zatwierdź</button></td>
  33.                 </tr>
  34.                 <tr>
  35.                 </tr>
  36.             </table>
  37.         </form>
  38.     </center>
  39. </body>
  40. <script src="./index.js"></script>
  41.  
  42. </html>
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52. /////// PHP
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. <?php
  65.  
  66. $con = mysqli_connect("localhost", "root", "", "tp__2");
  67.  
  68. $imie =  $_POST['imie'];
  69. $nazwisko = $_POST['nazwisko'];
  70.  
  71.  
  72. $sql = "INSERT INTO lista_obecnosci (imie, nazwisko, obecnosc) VALUES ('$imie','$nazwisko','tak')";
  73. if(mysqli_query($con, $sql)){
  74.    echo '<body style="background-color: black;">';
  75.     echo '<p style="background-color: white;">Dodano Obecność;D</p>';
  76.     echo "$imie $nazwisko";
  77.     echo "</body>";
  78. } else{
  79.     echo "Błąd $sql. ";
  80. }
  81.  
  82.  
  83.  
  84. mysqli_close($con);
  85. ?>