$ids = explode(',', $_POST['count']);
for($i = 0; $i < count($ids); $i++) {
$level = $_POST['level' . $ids[$i]];
$institution = $_POST['institution' . $ids[$i]];
$board = $_POST['board' . $ids[$i]];
$division = $_POST['division' . $ids[$i]];
echo "level: " . $level;
echo " institution: " . $institution;
echo " board: " . $board;
echo " division: " . $division;
echo "<br />";
}
How can I assemble all of the above into a single string: $message = "code here";? I have tried $message = "$ids"; but it’s shows me “Array”. It should send all results to email but it sends only first line of results if I use $message = "level: $level institution: $institution board: $board division: $division";
Example of desired results:
// only sends the first line
level: test1 institution: test2 board: test3 division; test4
level: test10 institution: test20 board: test30 division; test40
I dynamically add, remove and validate form fields in jQuery from the link below http://www.pradipchitrakar.com.np/blog/dynamically-add-remove-textfield.html
<?php
// Contact subject
$subject ="new order ";
// Details
$message="**cant work out code here for all results to display**";
// Mail of sender
$mail_from="$email";
// From
$header="from: $name <$email>";
// Enter your email address
$to ='test@mail.com';
$send_contact=mail($to,$subject,$message,$header);
// Check, if message sent to your email
// display message "We've recived your information"
if($send_contact){
echo "We've recived your contact information";
} else {
echo "ERROR";
}
?>
Email mesages can contain differently formated content. By default they are plaintext. To obtain the effect of line breaks, the best way is to send an HTML formated email. Even better, you could format your data as a table.
This is the HTML mail example from http://php.net/manual/en/function.mail.php addapted to your snippet: