Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action="wyswietl.php" method="post">
- Nick: <input type="text" name="name" /><br />
- Data: <input type="text" name="date" /><br />
- E-Mail: <input type="text" name="mail" /><br />
- Treść: <input type="text" name="wiadomosc" /><br />
- <input type="submit" value="Wyslij" />
- </form>
- <?php
- include('config.php');
- $name = ($_POST['name']);
- $date = ($_POST['date']);
- $mail = ($_POST['mail']);
- $wiadomosc = ($_POST['wiadomosc']);
- $sql = mysql_connect ($host, $login, $passwd) or die('Brak połączenia z serwerem MySQL');
- mysql_select_db("$database");
- if (empty($_POST['name']) && empty($_POST['date']) && empty($_POST['mail']) && empty($_POST['wiadomosc'])) {
- echo ('<h5>Wypełnij wszystkie pola!</h5>');
- } else {
- $zapytanie = "INSERT INTO `Comments` (`id`, `name`, `date`, `mail` , `wiadomosc`) VALUES ('null','$name', '$date', '$mail', '$wiadomosc')";
- $idzapytania = mysql_query($zapytanie);
- }
- ?>
- <a href="wyswietl.php">Wyswietl newsy</a>
Add Comment
Please, Sign In to add comment