wap3
12-11-2002, 02:51 PM
Hello everyone, :)
I amtrying to figure out how I can email the results of a form and the details in my session.
This is the code I have for it so far. It emails the form details, thats not the problem. The problem is sending the session details.
I tried to add something to the bottom whihc you can see to try and get it to email it to me but it doesn't work.
Can I do it like this ?? Any ideas on how it can be done ??
Thanks guys
:thumbsup:
function mail_basket($formvars) {
$ouraddress = "email@domain.co.uk";
$subject = "Form and session content";
$content = "The following details are from the form and sesison"."\n\n"
."-------------------------------------------------------"."\n"
."Personal Details"."\n"
."-------------------------------------------------------"."\n\n"
."Title: ".$formvars[title]."\n"
."First Name: ".$formvars[firstname]."\n"
."Last Name: ".$formvars[lastname]."\n"
."Address: ".$formvars[address]."\n"
."Postcode: ".$formvars[postcode]."\n\n"
."Telephone: ".$formvars[telephone]."\n"
."E-mail: ".$formvars[email]."\n\n"
."Comments: ".$formvars[comments]."\n\n"
."Hiredate: ".$formvars[hiredate]."\n\n"
."Estimated Duration: ".$formvars[duration]."\n\n";
foreach($_SESSION['cart'] as $Item_id => $quantity) {
$item = get_items_forbasket($Item_id)
foreach ($item as $row) {
$items = "Quantity: ".$quantity."\n"
."Item: ".$row[Description]."\n"
."Weekly Rate: ".$row[One_Week]."\n"; }
}
$additional_headers = "From: ".$formvars[email]."\n";
mail($ouraddress, $subject, $content . $items, $additional_headers);
return true;
}
I amtrying to figure out how I can email the results of a form and the details in my session.
This is the code I have for it so far. It emails the form details, thats not the problem. The problem is sending the session details.
I tried to add something to the bottom whihc you can see to try and get it to email it to me but it doesn't work.
Can I do it like this ?? Any ideas on how it can be done ??
Thanks guys
:thumbsup:
function mail_basket($formvars) {
$ouraddress = "email@domain.co.uk";
$subject = "Form and session content";
$content = "The following details are from the form and sesison"."\n\n"
."-------------------------------------------------------"."\n"
."Personal Details"."\n"
."-------------------------------------------------------"."\n\n"
."Title: ".$formvars[title]."\n"
."First Name: ".$formvars[firstname]."\n"
."Last Name: ".$formvars[lastname]."\n"
."Address: ".$formvars[address]."\n"
."Postcode: ".$formvars[postcode]."\n\n"
."Telephone: ".$formvars[telephone]."\n"
."E-mail: ".$formvars[email]."\n\n"
."Comments: ".$formvars[comments]."\n\n"
."Hiredate: ".$formvars[hiredate]."\n\n"
."Estimated Duration: ".$formvars[duration]."\n\n";
foreach($_SESSION['cart'] as $Item_id => $quantity) {
$item = get_items_forbasket($Item_id)
foreach ($item as $row) {
$items = "Quantity: ".$quantity."\n"
."Item: ".$row[Description]."\n"
."Weekly Rate: ".$row[One_Week]."\n"; }
}
$additional_headers = "From: ".$formvars[email]."\n";
mail($ouraddress, $subject, $content . $items, $additional_headers);
return true;
}