Hello all,
I have some code below that creates an email from a web form :
[code=php]<?php
// create the email message
$msg .= “Please create this account and credit it with $10 nnn”;
$msg .= “ACCOUNT DETAILS nn”;
if ($nickname != “”) {
$msg .= “Nick Name : $nicknamen”;
}
if ($username != “”) {
$msg .= “User Name : $usernamen”;
}
if ($password != “”) {
$msg .= “Password : $passwordnn”;
}
$msg .= “Personal DETAILS nn”;
if ($from != “”) {
$msg .= “First Name : $fromn”;
}
if ($middlename != “”) {
$msg .= “Middle Name : $middlenamen”;
}
if ($lastname != “”) {
$msg .= “Last Name : $lastnamen”;
}
if ($dateofbirth != “”) {
$msg .= “Date of Birth : $dateofbirthn”;
}
$msg .= “Address : $addressn”;
if ($town != “”) {
$msg .= “Town : $townn”;
}
if ($postcode != “”) {
$msg .= “Postcode : $postcoden”;
}
if ($county != “”) {
$msg .= “County : $countyn”;
}
if ($country != “”) {
$msg .= “Country : $countryn”;
}
if ($telephone != “”) {
$msg .= “Telephone : $telephonen”;
}
if ($email != “”) {
$msg .= “Email : $emailn”;
}
if ($bigslickprivate != “”) {
$msg .= “Join the Big Slick Private Members club? : $bigslickprivaten”;
}
if ($bigslickplayers != “”) {
$msg .= “Join the Big Slick Players Club? : $bigslickplayersn”;
}
if ($bigslickpreffered != “”) {
$msg .= “Obtain membership to Big Slick’s preferred members club? : $bigslickprefferednn”;
}
$msg .= “Sent : $todayn”;
$mailheaders = “Poker account registration ( $username ) n”;
$mailheaders = “From: $email”;
mail($to, $subject, $msg, $mailheaders);
I am trying to have the users email address (the person who has just filled out the form) appear in the “from” field, but the webserver seems to fill in its own address.
here is how I have the from address set up :
[code=php]$mailheaders = “From: $email”;
the $email variable is populated from a form field. Any Ideas how to do this?
Thanks