# Mailform reply message

**URL:** <https://forum.kirupa.com/t/mailform-reply-message/195111>\
**Category:** programming\
**Created:** [July 28, 2006, 1:45pm UTC](https://forum.kirupa.com/t/mailform-reply-message/195111 "2006-07-28T13:45:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vectar](https://avatars.discourse-cdn.com/v4/letter/v/b2d939/32.png) [@Vectar](https://forum.kirupa.com/u/Vectar)\
**Post date:** [July 28, 2006, 1:45pm UTC](https://forum.kirupa.com/t/mailform-reply-message/195111/1 "2006-07-28T13:45:26Z")

</div>

I am working on a contact form.  
The contact form is placed on a page called contact.php and is loaded into a main page.  
When someone send a email it reply’s with a thank you message.  
This is done with this script

```php
<?php
if($_POST['submitform']) {

$Naam = $HTTP_POST_VARS['Naam'];
$Email = $HTTP_POST_VARS['Email'];
$Bericht = $HTTP_POST_VARS['Bericht'];

$dcheck = explode(",",$require);
while(list($check) = each($dcheck)) {
if(!$$dcheck[$check]) {
$error .= "$dcheck[$check] ontbreekt<br>";
}
}

if ((!ereg(".+\@.+\..+", $Email)) || (!ereg("^[a-zA-Z0-9_@.-]+$", $Email))){
$error .= "Email adres is niet juist<br>";}

if($error) {
?>
          <b>FOUT MELDING</b><br>
          <?php echo $error; ?><br>
          <a href="#" onClick="history.go(-1)">Probeer opnieuw</a>
          <?php
}
else 
{

$browser = $HTTP_USER_AGENT;
$ip = $REMOTE_ADDR;

$message = "Bericht voor $recipientname:

Naam: $Naam
Email: $Email

Bericht: $Bericht

-----------------------------

Browser: $browser
User IP: $ip";

mail($recipientemail,"$subject","$Bericht","From: $Naam <$Email>");

if($autoresponse == "yes") {
$autosubject = stripslashes($autosubject);
$automessage = stripslashes($automessage);
mail($Email,"$autosubject","$automessage","From: $recipientname <$recipientemail>");
}

echo "$thanks";
}
} 
else {
?>

```

Problem is that all the messages are reply’d in the contact.php, this is correct but the contact.php should not open as a new blank page but should open into main.html like it opens when i click on the contact button.  
Can somebody tell me how i can make this work.

Thanks in advance
