You can get fancy in checking for a valid email using regular expression and all that crap, but here is the structure on how you would add in your form validation into your current script:
<?
$to="me@myself.co.uk";
$from=$_POST['from'];
$subject=$_POST['subject'];
$name=$_POST['name'];
$webaddress=$_POST['webaddress'];
$comments=$_POST['comments'];
$redirect = "thankyou.php";
$message="From:$name\n$email\nWeb Address: $webaddress\n\n$comments";
// form validation
if(empty($email)) $error_msg="You must enter an email address<br />";
if(empty($name)) $error_msg.="You must enter a name<br />";
if(empty($subject)) $error_msg.="You must enter a subject<br />";
if(empty($comments)) $error_msg.="You must enter your comments<br />";
// if no error msg, then proceed, otherwise, redirect to display error messages
if(!empty($error_msg)) header("Location: form_entry.php?error_msg=$error_msg");
if(mail($to,$subject,$message,"From: $email\n")) {
header("Location: $redirect");
} else {
echo "There was a problem sending the mail.";
}
?>
With the code above, I'm assuming the form php file is called form_entry.php. Since I'm passing $error_msg over to form_entry.php redirect, you can use the variable to display form error messages. Hope that helps!