PDA

View Full Version : nobody appears in the from section


dazzclub
05-16-2007, 12:49 AM
hi guys ive been working on a php contact form and with the help of you guys i added some code that allows a second person to recieve a blind copy of the email.

the problme was both the blindcopy and the email from code where the same in the mail line of code ( what the fook!!?). i tried changing it so it would work but sadly, no fun there. so what i did was to remove it and see what i could do from there.

so now when i complete the form and send it, rather tahn having the useres email address in the from section it reads nobody?

any ideas to waht i can do??

cheers


<?php





// get posted data into local variables

$EmailFrom = Trim(stripslashes($_POST['email']));



$EmailTo = "mainemail@mail.com";














$Subject = "email form";



$contacting_us = Trim(stripslashes($_POST['contacting_us']));

$message = Trim(stripslashes($_POST['message']));

$forename = Trim(stripslashes($_POST['forename']));

$surname = Trim(stripslashes($_POST['surname']));

$company = Trim(stripslashes($_POST['company']));

$if_other_directmailer = Trim(stripslashes($_POST['if_other_directmailer']));

$other_search_engine = Trim(stripslashes($_POST['other_search_engine']));

$telephone = Trim(stripslashes($_POST['telephone']));

$mobile = Trim(stripslashes($_POST['mobile']));

$EmailFrom = Trim(stripslashes($_POST['email']));

$address_1 = Trim(stripslashes($_POST['address_1']));

$address_2 = Trim(stripslashes($_POST['address_2']));

$address_3 = Trim(stripslashes($_POST['address_3']));

$city = Trim(stripslashes($_POST['city']));

$state = Trim(stripslashes($_POST['state']));

$zip = Trim(stripslashes($_POST['zip']));

$country = Trim(stripslashes($_POST['country']));

$if_country_not_stated = Trim(stripslashes($_POST['if_country_not_stated']));

$industry_type = Trim(stripslashes($_POST['industry_type']));

$add_comments = Trim(stripslashes($_POST['add_comments']));

$time_frame = Trim(stripslashes($_POST['time_frame']));

$google = Trim(stripslashes($_POST['google']));

$kelly_search = Trim(stripslashes($_POST['kelly_search']));

$alta_vista = Trim(stripslashes($_POST['alta_vista']));

$yahoo = Trim(stripslashes($_POST['yahoo']));

$msn = Trim(stripslashes($_POST['msn']));

$leaflet = Trim(stripslashes($_POST['leaflet']));

$othermailer = Trim(stripslashes($_POST['othermailer']));

$msn = Trim(stripslashes($_POST['msn']));

$word_of_colleague = Trim(stripslashes($_POST['word_of_colleague']));

$word_of_supplier = Trim(stripslashes($_POST['word_of_supplier']));

$telephone_contact = Trim(stripslashes($_POST['telephone_contact']));

$email_contact = Trim(stripslashes($_POST['email_contact']));



// variables are sent to this PHP page through

// the POST method. $_POST is a global associative array

// of variables passed through this method. From that, we

// can get the values sent to this page from Flash and

// assign them to appropriate variables which can be used

// in the PHP mail() function.







// prepare email body text


$headers .= 'Bcc: blindcopy@mail.com' . "\r\n";


$Body = "B&H Colour change - Thermochromic Inks:";

$Body .= "\n";

$Body .= "\n";

$Body .= "contacting_us: ";

$Body .= $contacting_us;

$Body .= "\n";

$Body .= "message: ";

$Body .= $message;

$Body .= "\n";

$Body .= "\n";

$Body .= "Personal Details: ";

$Body .= "\n";

$Body .= "-----------------: ";

$Body .= "\n";

$Body .= "forename: ";

$Body .= $forename;

$Body .= "\n";

$Body .= "surname: ";

$Body .= $surname;

$Body .= "\n";

$Body .= "email: ";

$Body .= $email;

$Body .= "\n";

$Body .= "telephone: ";

$Body .= $telephone;

$Body .= "\n";

$Body .= "mobile: ";

$Body .= $mobile;

$Body .= "\n";

$Body .= "\n";

$Body .= "Company Details: ";

$Body .= "\n";

$Body .= "-----------------: ";

$Body .= "\n";

$Body .= "company: ";

$Body .= $company;

$Body .= "\n";

$Body .= "address_1: ";

$Body .= $address_1;

$Body .= "\n";

$Body .= "address_2: ";

$Body .= $address_2;

$Body .= "\n";

$Body .= "address_3: ";

$Body .= $address_3;

$Body .= "\n";

$Body .= "state: ";

$Body .= $state;

$Body .= "\n";

$Body .= "city: ";

$Body .= $city;

$Body .= "\n";

$Body .= "zip: ";

$Body .= $zip;

$Body .= "\n";

$Body .= "country: ";

$Body .= $country;

$Body .= "\n";

$Body .= "if_country_not_stated: ";

$Body .= $if_country_not_stated;

$Body .= "\n";

$Body .= "\n";

$Body .= "Marketing Data: ";

$Body .= "\n";

$Body .= "-----------------: ";

$Body .= "\n";

$Body .= "industry_type: ";

$Body .= $industry_type;

$Body .= "\n";

$Body .= "Direct_Mailer_used: ";

$Body .= "\n";

$Body .= $leaflet;

$Body .= "\n";

$Body .= $magazine;

$Body .= "\n";

$Body .= $othermailer;

$Body .= "\n";

$Body .= "if_other_directmailer: ";

$Body .= $if_other_directmailer;

$Body .= "\n";

$Body .= "Search_Engine_Used: ";

$Body .= "\n";

$Body .= " ";

$Body .= $google;

$Body .= "\n";

$Body .= $kelly_search;

$Body .= "\n";

$Body .= $alta_vista;

$Body .= "\n";

$Body .= $yahoo;

$Body .= "\n";

$Body .= $msn;

$Body .= "\n";

$Body .= $othersearchengine;

$Body .= "\n";

$Body .= "other_search_engine: ";

$Body .= $other_search_engine;

$Body .= "\n";

$Body .= "\n";

$Body .= "Word of mouth: ";

$Body .= "\n";

$Body .= "-----------------: ";

$Body .= "\n";

$Body .= $word_of_colleague;

$Body .= "\n";

$Body .= $word_of_supplier;

$Body .= "\n";

$Body .= "\n";

$Body .= "Method of contact: ";

$Body .= "\n";

$Body .= "-----------------: ";

$Body .= "\n";

$Body .= $telephone_contact;

$Body .= "\n";

$Body .= $email_contact;

$Body .= "\n";

$Body .= "\n";

$Body .= "add_comments: ";

$Body .= $add_comments;

$Body .= "\n";

$Body .= "time_frame: ";

$Body .= $time_frame;

$Body .= "\n";





// send email
$success = mail($EmailTo, $Subject, $Body, $headers );



if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.html\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>

davidj
05-16-2007, 09:09 AM
try this...


$EmailFrom = Trim(stripslashes($_POST['email']));

$headers = $EmailFrom."\r\n";
$headers .= 'Bcc: blindcopy@mail.com' . "\r\n";