Hey guys
Ok, I have one file, with two forms, one for debit orders and one for credit cards. When a user opens the page, he gets a drop down menu, from which he has to choose one, and then that form gets diaplyed, this all works fine, all done in PHP, no jscript. My problem now is, I want to email the details, but the forms are different, thus the email content will be different as well. I tried doing so with a self defined function, and switch(), but with no luck. Below is the pieces of code I used:
This is the intro, to select which form to display, and it works well.
if ($Payment = 'Debit') {
debit();
} elseif ($Payment = 'Credit') {
credit();
} else {
select();
Then, this is to email the content.
function bank_details()
{
switch ($Payment) {
case "Debit":
debitorder();
break;
case "Credit";
creditcard();
break;
}
function debitorder()
{
$bank_details = "AccountHolders Name: $account_holders_name\n";
$bank_details .= "Account Number: $account_number\n";
$bank_details .= "Bank Name: $bank_name\n";
$bank_details .= "Branch Name: $Branch_name\n";
$bank_details .= "Branch Number: $branch_number\n";
$bank_details .= "Branch Number: $branch_number\n";
}
function creditcard()
{
$bank_details = "Card Holder: $CardHolder\n";
$bank_details .= "Card Number: $CardNumber\n";
$bank_details .= "CvvNumber: $CvvNumber\n";
$bank_details .= "CardType: $CardType\n";
$bank_details .= "CardMonth: $CardMonth\n";
$bank_details .= "CardYear: $CardYear\n";
}
}
I call bank_details() as follows:
$content .="Firstname: $first_name\n
Lastname: $last_name\n
ID Number: $your_id_number\n
Company Name: $company\n
Postal Address: $postal_address_1\n
Postal Address2: $postal_address_2\n
Postal code: $postal_code\n
Email: $email\n
Work Phone: $work_phone_number\n
Work Code: $work_phone_number_code\n
Home Phone: $phone_home\n
Home Code: $phone_home_code\n
Faxn Nmber: $fax_number\n
Fax Code: $fax_number_code\n
Cell: $phone_cell\n
Domain Name: $domain_name\n
Hosting Option: $Hosting_option\n
Upload Option: $Upload_option\n
Application Description: $ApplicationDesc\n
$bank_details
$reseller
Agreed: $agreed_with_the_terms_and_conditions\n";
It doesn't seem to display the bank detail though, on either form. Is there
anyway of getting this done?