Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Dodaj Sprzątanie</title>
- <meta charset="UTF-8">
- </head>
- <body>
- <form method="POST" action="dodaj_sprzatanie.php">
- <b>Sprzęt:</b> <input type="text" name="sprzet" size="5" maxlength="10"><br>
- <b>Cena:</b> <input type="text" name="cena" size="5" maxlength="10"><i>zł</i><br>
- <b>Czas:</b> <input type="text" name="czas" size="5" maxlength="10"><i>godzin</i><br>
- <input type="submit" name="submit" value="Dodaj" class="przycisk">
- </form>
- <a href="index.php">Powrót na strone główną</a>
- </body>
- </html>
- <?php
- session_start();
- if((isset($_POST['sprzet']) && (isset($_POST['cena'])) && (isset($_POST['czas'])))) {
- $sprzet = $_POST['sprzet'];
- $cena = $_POST['cena'];
- $czas = $_POST['czas'];
- $connect = @mysql_connect('localhost', 'root', '');
- $nazwa_bazy = @mysql_select_db('zajecia_domowe', $connect);
- $zapytanie = @mysql_query("INSERT INTO sprzatanie VALUES ('', '$sprzet', '$cena', '$czas')");
- if($zapytanie) echo "Rekord został dodany poprawnie";
- else echo "Błąd nie udało się dodać nowego rekordu";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement