<? include_once('inc/db.php');//connect db #### FORM #### echo' <form action="" method="post"> <input name="name" size="30" maxlength="50" value="" ><br /> <input name="text" size="30" maxlength="500" value="" ><br /> <input type="submit" name="submit" value="Next"> </form>'; #### FORM #### if (isset($_POST['submit'])) { $name = trim(htmlspecialchars($_POST['name'])); $text = trim(htmlspecialchars($_POST['text'])); if (!empty($name) && !empty($text)){ echo'Успешно добавлено!'; mysql_query("INSERT INTO `table` (`name`, `text`) VALUES ('$name','$text');"); } } ?>