I'm notsure exactly what you're trying to do, but if this helps, here's a basic contact form layout:
<?php
$your_email = 'user@domain.com';
$name = isset($_POST['name']) ? $_POST['name'] : '';
$email = isset($_POST['email']) ? $_POST['email'] : '';
$content = isset($_POST['content']) ? $_POST['content'] : '';
if(empty($name) || empty($email) || empty($content)){
if(isset($_POST['submitbtn'])){
$msg = 'Please fill out the form fully.';
}else{
$msg = '';
}
}else{
// you should probably do some validation here
if(mail($your_email, 'Contact Form Message From '.$name, $content, 'Reply-To: '.$email)){
$msg = 'Email sent successfully';
}else{
$msg = 'Email could not be sent';
}
$name = $email = $content = '';
}
?>
<form action="thisfile.php" method="post">
Name: <input type="text" name="name" value="<?php echo $name; ?>" />
Email: <input type="text" name="email" value="<?php echo $email; ?>" />
<textarea name="content"><?php echo $content; ?></textarea>
<input type="submit" name="submitbtn" value="Send" />
<?php echo $msg; ?>
</form>
Note that this is by no means complete, and requires validation and output filtering (htmlentities) among other things. I hope it helps.