SHARE
TWEET

Untitled

a guest Oct 15th, 2019 105 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2. <head>
  3. <meta charset=utf-8>
  4. </head>
  5. <body>
  6. <a href="plik.php">>>MENU</a>
  7. <h2> Dodawanie rekordów do tabeli  </h2>
  8. <form method="POST">
  9. <table>
  10. <tr><td>Imię:</td><td> <input type="text" name="i" /></td></tr>
  11. <tr><td>Nazwisko:</td><td> <input type="text" name="n" /></td></tr>
  12. <tr><td>Kod:</td><td> <input type="text" name="k" /></td></tr>
  13. <tr><td>Miasto:</td><td> <input type="text" name="m" /></td></tr>
  14. <tr><td>Ulica:</td><td> <input type="text" name="u" /></td></tr>
  15. <tr><td>tel:</td><td> <input type="text" name="t" /></td></tr>
  16. <tr><td>e-mail:</td><td> <input type="text" name="e-mail" /></td></tr>
  17. <tr><td>Data urodzenia:</td><td> <input type="text" name="data" /></td></tr>   
  18. <input type="submit" name="przycisk" value="Dodaj rekord">
  19.  
  20. </form>
  21. </table>
  22. <?php
  23. $p=mysqli_connect('localhost', 'root','','test1');
  24. if(!$p) echo 'Nie działa';
  25. if(!empty($_POST['i'])&& !empty($_POST['n'])){
  26. $i=$_POST['i']; $n=$_POST['n'];
  27. // echo $i.' '.$n;
  28. $z="INSERT tKlienci (imie, nazwisko) VALUES ('$i','$n')";
  29. if (mysqli_query($p,$z)) echo 'dodano';
  30. else echo 'nie dodano';
  31.  
  32. }
  33.  
  34.  
  35. mysqli_close($p);
  36. ?>
  37.  
  38. </body>
  39. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top