$name = $_POST['name'];
$text = $_POST['text'];
$submit = $_POST['submit'];
if(isset($_POST['submit'])){
if($_POST['name'] != "1"){
$query = mysql_query("INSERT INTO comments(name,text) VALUES ('$name','$text')");
header('Location: index.php');
exit();
}
else{
echo "Вы не указали имя";
}
}
header('Location: index.php');
exit();