Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-02-2006, 04:02 PM   PM User | #1
fogofogo
New Coder

 
Join Date: Sep 2005
Posts: 89
Thanks: 2
Thanked 0 Times in 0 Posts
fogofogo is an unknown quantity at this point
problems with email

Hello all,

I have some code below that creates an email from a web form :

PHP Code:
<?php
// create the email message

$msg .= "Please create this account and credit it with $10 \n\n\n";

$msg .= "ACCOUNT DETAILS \n\n";

if (
$nickname != "") {
     
$msg .= "Nick Name : $nickname\n";
     }
if (
$username != "") {
     
$msg .= "User Name : $username\n";
     }
if (
$password != "") {
     
$msg .= "Password : $password\n\n";
     }
$msg .= "Personal DETAILS \n\n";

if (
$from != "") {
     
$msg .= "First Name : $from\n";
     }
if (
$middlename != "") {
     
$msg .= "Middle Name : $middlename\n";
     }
if (
$lastname != "") {
     
$msg .= "Last Name : $lastname\n";
     }
if (
$dateofbirth != "") {
     
$msg .= "Date of Birth : $dateofbirth\n";
     }
$msg .= "Address : $address\n";

if (
$town != "") {
     
$msg .= "Town : $town\n";
     }
if (
$postcode != "") {
     
$msg .= "Postcode : $postcode\n";
     }
if (
$county != "") {
     
$msg .= "County : $county\n";
     }
if (
$country != "") {
     
$msg .= "Country : $country\n";
     }
if (
$telephone != "") {
     
$msg .= "Telephone : $telephone\n";
     }
if (
$email != "") {
     
$msg .= "Email : $email\n";
     }

if (
$bigslickprivate != "") {
     
$msg .= "Join the Big Slick Private Members club? : $bigslickprivate\n";
     }
if (
$bigslickplayers != "") {
     
$msg .= "Join the Big Slick Players Club? : $bigslickplayers\n";
     }
if (
$bigslickpreffered != "") {
     
$msg .= "Obtain membership to Big Slick's preferred members club? : $bigslickpreffered\n\n";
     }
$msg .= "Sent : $today\n";

$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 :

PHP Code:
$mailheaders "From: $email"
the $email variable is populated from a form field. Any Ideas how to do this?

Thanks
fogofogo is offline   Reply With Quote
Old 05-02-2006, 06:53 PM   PM User | #2
goughy000
Regular Coder

 
goughy000's Avatar
 
Join Date: Nov 2005
Location: England
Posts: 415
Thanks: 0
Thanked 0 Times in 0 Posts
goughy000 is an unknown quantity at this point
are you setting the $email var correctly?

PHP Code:
//If its from a POST method form
$email $_POST['email'];

//if its in the url (GET method)
$email $_POST['email']; 

EDIT:
also... whats all this about:
PHP Code:
$mailheaders "Poker account registration ( $username ) \n"
didnt you mean
PHP Code:
$subject "Poker account registration ( $username ) \n"
???

or to be more syntax correct...
PHP Code:
$subject "Poker account registration ( " $username " ) \n"
__________________
PHP Freelancing!
ByteForums!
Scriptlance.comNeed a job done quick? post it on scriptlance! OR! your a programmer? sign up and get paid for these jobs!

Last edited by goughy000; 05-02-2006 at 06:55 PM..
goughy000 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:22 AM.


Advertisement
Log in to turn off these ads.