The reason is simple: instead of testing if $ErrMsg is equal to a blank string, you set it to a blank string.
$ErrMsg = "";
if (!empty($Submit))
{
if (empty($ConName))
$ErrMsg .= "Please enter your name.<BR>";
if (empty($ConLastName))
$ErrMsg .= "Please enter your last name.<BR>";
if (empty($ConEMail))
$ErrMsg .= "Please enter your e-mail.<BR>";
if (empty($ConRemark))
$ErrMsg .= "Please enter your comment.<BR>";
//test if $ErrMsg is blank
if ($ErrMsg == "")
{
$sql = "INSERT INTO remark
VALUES ('', '$ConName', '$ConLastName', '$ConEmail', '$ConTel', '$ConRemark')";
if (mysql_query($sql))
{
echo "Thank you";
exit; //is this necessary here?
}
else
{
echo mysql_errno();
}
}
else
{
echo $ErrMsg;
}
}