Code: Select all
$message = "Hello thanks for your purchase here is your information $variable1 $variable2 $variable3";How can I do this?
I hope this is clear.
thanks,
Marcel
Moderator: General Moderators
Code: Select all
$message = "Hello thanks for your purchase here is your information $variable1 $variable2 $variable3";Code: Select all
$variables = array('dataone','datatwo','datathree');
//or
$variables[0] = 'dataone';
$variables[1] = 'datatwo';
//...Code: Select all
$message = "Hello..blah,blah,blah....\n\n";
for ($i=0; $i < count($variables); $i++) {
if (!empty($variables[$i])) $message .= $variables[$i]."\n";
}Code: Select all
$variables = array(
'nameone' => 'dataone',
'nametwo' => 'datatwo',
//...
);
//or
$names = array('nameone','nametwo','namethree');
$variables = array('dataone','datatwo','datathree');Code: Select all
foreach ($variables as $name => $data) {
$messages .= $name . ": " . $data;
}
//or
for ($i=0; $i < count($names); $i++) {
if (!empty($variables[$i])) $message .= $names[$i] . ': ' . $variables[$i]."\n";
}Code: Select all
$result = mysql_query("SELECT * FROM `table_name`");
while ($row = mysql_fetch_assoc($result)) {
$messages .= $row['variableone'] . $row['variabletwo']; //...
}Code: Select all
if ($quantity > 1) {
//used is not equal to zero
$sql="SELECT * FROM keymail WHERE used != '0' LIMIT '$quantity'";
$query=mysql_query($sql);
$result=mysql_fetch_object($query);
$message="Dear $first_name, \n \n Thank you for your order. We have received your payment and have processed your order, please do not disregard this email as it will serve as your receipt and also contains your software key code. \n \n Order Details:\n Description: $item_name \n Price: $payment_amount \n \n Instructions: \n 1. Download the Norman Installer from the following location: http://www.nothing.com \n 2. After running the installer you will be prompted to enter the key code, please copy and paste the following key code: \n \n $result->key_code \n \n 3. For further information on using and installing Norman Antivirus please refer to the manual: http://download.norman.no/manuals/eng/N ... de_eng.pdf \n \n This key is only valid for use on a single PC. \n \n Thank you again, \n The Nexgen Team \n \n";
$i=0;
while ($i < $quantity) {
$kode=mysql_result($result,$i,"key_code");
$kode$i = $kode
$i++;
}
}Code: Select all
$message="Dear $first_name,\n\n".
"Thank you for your order. We have received your payment and have processed your order, please do not disregard this email as it will serve as your receipt and also contains your software key code.\n\n".
"Order Details:\n".
"Description: $item_name\n".
"Price: $payment_amount\n\n".
"Instructions:\n".
"1. Download the Norman Installer from the following location: http://www.nothing.com\n".
"2. After running the installer you will be prompted to enter the key code, please copy and paste the following key code:\n\n".
"$result->key_code\n\n".
"3. For further information on using and installing Norman Antivirus please refer to the manual: http://download.norman.no/manuals/eng/N ... de_eng.pdf\n\n".
"This key is only valid for use on a single PC.\n\n".
"Thank you again,\n".
"The Nexgen Team\n\n";Code: Select all
$result = mysql_query("SELECT * FROM keymail WHERE used != '0' LIMIT '$quantity'");
$message="Dear $first_name,\n\n".
"Thank you for your order. We have received your payment and have processed your order, please do not disregard this email as it will serve as your receipt and also contains your software key code.\n\n".
"Order Details:\n".
"Description: $item_name\n".
"Price: $payment_amount\n\n".
"Instructions:\n".
"1. Download the Norman Installer from the following location: http://www.nothing.com\n".
"2. After running the installer you will be prompted to enter the key code, please copy and paste the following key code:\n\n";
while ($row = mysql_fetch_assoc($result)) {
$message .= $row['keycode']."\n"; // no idea how you store your information here.
}
$message .= "\n".
"3. For further information on using and installing Norman Antivirus please refer to the manual: http://download.norman.no/manuals/eng/N ... de_eng.pdf\n\n".
"This key is only valid for use on a single PC.\n\n".
"Thank you again,\n".
"The Nexgen Team\n\n";Code: Select all
for ($i=0, $kodes=array(); $i < $quantity; $i++) {
$kodes[$i] = mysql_result(($result,$i,"key_code");
}Code: Select all
$kodes = array();
for ($i=0; $i < $quantity; $i++) {
$kodes[$i] = mysql_result(($result,$i,"key_code");
}