if($_POST['submit'] AND $_POST['text']){ } echo "$row[time]:$row[login]:$row[text] <br>"; } echo "<form method = 'POST' action='chat.php'> <textarea name='text'></textarea><br><br> <input type = 'submit' name = 'submit' value = 'Отправить'> </form>";