I'm so confused right now.. I have set up a database which is working with my registration form. I wanted to have the form submitted via email at the same time the info is entered into the database. So far both of these functions are working but missing details and I am limited in my php to how to fix it. The email at the moment is coming in with the headers but not the information that was filled in.. the email message looks like this when it arrives

just filled in the registration form.

Their username is:

The password is:

Their e-mail address is:

My code is below

PHP Code:
<?php

    
//Start session
    
session_start();
    
    
/* Set e-mail recipient */
    
$myemail  "catfish@telus.net";
    
$subject  "Membership Registration";
    
$message "$fname $lname just filled in the registration form.\n\nTheir username is:\n$login\n\nThe password is:\n$password\n\nTheir e-mail address is: $email";
    
    
//Include database connection details
    
require_once('config.php');
    
    
//Array to store validation errors
    
$errmsg_arr = array();
    
    
//Validation error flag
    
$errflag false;
    
    
//Connect to mysql server
    
$link mysql_connect(DB_HOSTDB_USERDB_PASSWORD);
    if(!
$link) {
        die(
'Failed to connect to server: ' mysql_error());
    }
    
    
//Select database
    
$db mysql_select_db(DB_DATABASE);
    if(!
$db) {
        die(
"Unable to select database");
    }
    
    
//Function to sanitize values received from the form. Prevents SQL injection
    
function clean($str) {
        
$str = @trim($str);
        if(
get_magic_quotes_gpc()) {
            
$str stripslashes($str);
        }
        return 
mysql_real_escape_string($str);
    }
    
    
//Sanitize the POST values
    
$fname clean($_POST['fname']);
    
$lname clean($_POST['lname']);
    
$email clean($_POST['email']);
    
$login clean($_POST['login']);
    
$password clean($_POST['password']);
    
$cpassword clean($_POST['cpassword']);
    
    
//Input Validations
    
if($fname == '') {
        
$errmsg_arr[] = 'First name missing';
        
$errflag true;
    }
    if(
$lname == '') {
        
$errmsg_arr[] = 'Last name missing';
        
$errflag true;
    }
    if(
$email == '') {
        
$errmsg_arr[] = 'Email address missing';
        
$errflag true;
    }
    if(
$login == '') {
        
$errmsg_arr[] = 'Login ID missing';
        
$errflag true;
    }
    if(
$password == '') {
        
$errmsg_arr[] = 'Password missing';
        
$errflag true;
    }
    if(
$cpassword == '') {
        
$errmsg_arr[] = 'Confirm password missing';
        
$errflag true;
    }
    if( 
strcmp($password$cpassword) != ) {
        
$errmsg_arr[] = 'Passwords do not match';
        
$errflag true;
    }
    
    
//Check for duplicate login ID
    
if($login != '') {
        
$qry "SELECT * FROM members2 WHERE login='$login'";
        
$result mysql_query($qry);
        if(
$result) {
            if(
mysql_num_rows($result) > 0) {
                
$errmsg_arr[] = 'Login ID already in use';
                
$errflag true;
            }
            @
mysql_free_result($result);
        }
        else {
            die(
"Query failed");
        }
    }
    
    
//If there are input validations, redirect back to the registration form
    
if($errflag) {
        
$_SESSION['ERRMSG_ARR'] = $errmsg_arr;
        
session_write_close();
        
header("location: register.php");
        exit();
    }

    
//Create INSERT query
    
$qry "INSERT INTO members2(firstname, lastname, email, login, password) VALUES('$fname','$lname', '$email', '$login','".md5($_POST['password'])."')";
    
$result = @mysql_query($qry);
    
    
//Check whether the query was successful or not
    
if($result) {
        
mail($myemail$subject$message);
        
header("location: register-success.php");
        exit();
    }else {
        die(
"Query failed");
    }
    
/* Prepare autoresponder subject */
$respond_subject "Thank you for contacting us!";

/* Prepare autoresponder message */
$respond_message "Hello!

Thank you for contacting us! We will get back to you
as soon as possible!

Yours sincerely,

Your name
www.yourwebsite.com
"
;

/* Send the message using mail() function */
mail($email$respond_subject$respond_message);    
?>
Then I am trying to do an autoresponding email which is at the end and doesn't work at all??
Thanks for you time with this...