Yes, you can replace //process form. Two slashes before something means that it is just a comment on the code. So getting rid of //process form won't change the script. In fact, this indicates that you should be putting the code that processes the form into this area. In this case, that would be the mail function.
So here's a solution:
<?php
If (empty($_POST['first_name']))
{
$errors[] = '<div class="goback">Please enter a name.<br><br><a href="http://www.xxxxxxxx.com/contact">Go Back</a></div>';
}
if (empty($_POST['email']))
{
$errors[] = '<div class="goback">Please enter an email address.<br><br><a href="http://www.xxxxxxxxx.com/contact">Go Back</a></div>';
}
else if (!eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$", $_POST['email']))
{
$errors[] = '<div class="goback">Please enter a valid email address.<br><br><a href="http://www.xxxxxxxxx.com/contact">Go Back</a></div>';
}
if (count($errors) == 0)
{
if (mail("XXXXX@XXXXX.com", "Jonathan Website Form", "
First Name: $first_name
Last Name: $last_name
Email: $email
Phone: $phone
Interested In: $interest
I Want To Tell You: $comment,"))
{ echo '<b>Sent Successfully!</b>'; }
else
{ echo '<div class="goback">An unexpected error occurred and the message was not sent. Please try again.<br /><br /><a href="http://www.xxxxxxxxx.com/contact">Go Back</a></div>'; }
}
else
{
echo $errors[0];
}
?>
What I did was I moved the mail function into the if (count($errors) == 0) conditional where it belongs. But I nested it in a conditional itself, so if the mail for some reason isn't sent, the user will be told that an unexpected error occurred and they should try again. If the mail is sent, I have the script writing that the message is sent successfully.
Hope this helps.