/ Published in: PHP
I use this to activate basic forms for clients. Just make sure your form input names are named appropriately. Any inputs such as phone or fax that are separated into different inputs should have the same name.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$headers = "Content-Type: text/html; charset=iso-8859-1\n"; $subject = "New Form Submission"; // set html email content $text = "<html><body>The form details are listed below:<br><br><table>"; // loop through POST foreach($_POST as $key => $value) { }else{ } } $text .= "<tr><td>".$key."</td><td>".$value."</td></tr>"; } $text .= "</table></body></html>"; // you may need to add some form inputs manually depending on your setup //email admin to notify of new submission