# Contactform: adding an error message

**URL:** <https://forum.kirupa.com/t/contactform-adding-an-error-message/193223>\
**Category:** Uncategorized\
**Created:** [July 5, 2006, 10:03am UTC](https://forum.kirupa.com/t/contactform-adding-an-error-message/193223 "2006-07-05T10:03:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kragster](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@kragster](https://forum.kirupa.com/u/kragster)\
**Post date:** [July 5, 2006, 10:03am UTC](https://forum.kirupa.com/t/contactform-adding-an-error-message/193223/1 "2006-07-05T10:03:49Z")

</div>

Hi I built this simple contactform on my webpage [www.kraghkrogh.dk using [URL=“http://www.kirupa.com/developer/actionscript/flash\_php\_email.htm”]this](http://www.kraghkrogh.dk) tutorial. What i need to add now is some kind of error message if the inputboxes hasn’t been filled out properly. So i figured it could work by jumping to a new frame with an errorline, if one of the following things happen:

1. no text in the name field.
2. no text in the message field.
3. the emails syntax is not name@domain.x  
Im a terrible coder so i hope someone can help me out adding the code :evil2: Here is the code i’ve used so far in the php script:

```php
 
<?php
$sendTo = "wereallinittogether@gmail.com";
$subject = "Reply from kraghkrogh.dk";
$headers = "From: " . $_POST["firstName"] ." ". $_POST["lastname"] . "<" . $_POST["email"] .">
";
$headers .= "Reply-To: " . $_POST["email"] . "
";
$headers .= "Return-path: " . $_POST["email"];
$message = $_POST["message"];
mail($sendTo, $subject, $message, $headers);
?>

```
