Hey everyone,
Im trying to setup a comment system on my site where the users add comments into a form, and they appear on the page underneath an article.
Anyhow, i want to make sure someone cant just hit the "submit" button on the form and submit a blank comment, so im using the little statment below to test if the user entered a subject and a comment before it gets posted:
<?php
if ((isSet($subject)) && (isSet($comment))) {
$sql = "INSERT INTO Comments SET article = '$vid', subject = '$subject', comment = '$comment', name = '$name'";
$query = mysql_query($sql) or die (mysql_error());
} else {
end;
}
?>
Problem is, it dosent work. I can still hit the submit button and subbmit a blank comment. Any ideas?
Thanks in advance!