I have spent a couple of hours wading through tutorials trying to find out how to do the following, they all seem to be far too complicated and there seems to be a million and one ways to do it:
I have 3 fields, FirstName, Surname, and Email. When the user hits submit, the data within the textboxes are passed to php, which in turn sends to my email ([email protected] for instance) with the subject "User Details". The user is then directed to "http://www.domain.com/thankyou.php"
Once this has been sent, I want to recieve an email at the above domain nicely formatted (must be in the correct order):
FirstName: Fred
Surname: Brown
Email: [email protected]
Why won't this work?
I have 3 fields, FirstName, Surname, and Email. When the user hits submit, the data within the textboxes are passed to php, which in turn sends to my email ([email protected] for instance) with the subject "User Details". The user is then directed to "http://www.domain.com/thankyou.php"
Once this has been sent, I want to recieve an email at the above domain nicely formatted (must be in the correct order):
FirstName: Fred
Surname: Brown
Email: [email protected]
Code:
<?
$recipient = '[email protected]' ;
$subject = 'User Details' ;
$FirstName = $_REQUEST['FirstName] ;
$Surname = $_REQUEST['Surname'] ;
$Email = $_REQUEST['Email'] ;
mail( "$recipient","$subject",
"\n First Name: \n $FirstName",
"\n Surname: \n $Surname",
"\n Email:\n $Email", ;
header( "Location: http://www.domain.com/thankyou.php" );
?>
Why won't this work?
