Advertisement
Guest User

Untitled

a guest
Oct 20th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>Dodaj Sprzątanie</title>
  4. <meta charset="UTF-8">
  5. </head>
  6. <body>
  7. <form method="POST" action="dodaj_sprzatanie.php">
  8. <b>Sprzęt:</b> <input type="text" name="sprzet" size="5" maxlength="10"><br>
  9. <b>Cena:</b> <input type="text" name="cena" size="5" maxlength="10"><i>zł</i><br>
  10. <b>Czas:</b> <input type="text" name="czas" size="5" maxlength="10"><i>godzin</i><br>
  11. <input type="submit" name="submit" value="Dodaj" class="przycisk">
  12. </form>
  13. <a href="index.php">Powrót na strone główną</a>
  14. </body>
  15. </html>
  16. <?php
  17. session_start();
  18. if((isset($_POST['sprzet']) && (isset($_POST['cena'])) && (isset($_POST['czas'])))) {
  19.  
  20. $sprzet = $_POST['sprzet'];
  21. $cena = $_POST['cena'];
  22. $czas = $_POST['czas'];
  23.  
  24. $connect = @mysql_connect('localhost', 'root', '');
  25. $nazwa_bazy = @mysql_select_db('zajecia_domowe', $connect);
  26.  
  27. $zapytanie = @mysql_query("INSERT INTO sprzatanie VALUES ('', '$sprzet', '$cena', '$czas')");
  28.  
  29. if($zapytanie) echo "Rekord został dodany poprawnie";
  30. else echo "Błąd nie udało się dodać nowego rekordu";
  31. }
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement