$value) { //check that all the fields have been filled if (empty($value)) { $error = '

Error - Please fill in all fields

'."\n\r"; echo "please fill in all fields before submitting"; //require_once "../includes/footer.php"; exit; } // strip the html tags off each post and stop the mysql injection (mysql injection = bad!) $_POST[$name] = strip_tags(mysql_real_escape_string($value)); } // this is the sql query to update the database $query = "INSERT INTO `comments` (name, comment) VALUES ('{$_POST[name]}', '{$_POST[comment]}')"; mysql_query($query) or die(mysql_error()); echo "thankyou for your comment"; } else { ?>

Please Leave A Comment







Error no comments!\n\r"; } while ($row = mysql_fetch_assoc($result)) { $row['title'] = stripslashes($row['name']); $row['text'] = stripslashes($row['comment']); $row['text'] = nl2br($row['comment']); echo '

'.$row['name']."

"; echo '

'.$row['comment']."\r\n

"; } ?>