I have tried 3 different tutorials on how to set up a php email form. All i want it to do, is email me the contents of my form. There are only 2 fields in the form, name and email. It neither sends me an email, nor re-direct to the thanks page.
The form’s “action” setting goes to the SendResults.php, on which the code reads (originally copied from the tutorial & adjusted for my own use):
<?php //--------------------------Set these paramaters-------------------------- $subject = 'Email list subscriber result'; $emailadd = [email]'[email protected][/email]; $url = 'http://www.alicetrailersupplies.com.au/subscribethanks.html'; $req = '1'; // --------------------------Do not edit below this line-------------------------- $text = "Results from form:\n\n"; $space = ' '; $line = ' '; foreach ($_POST as $key => $value) { if ($req == '1') { if ($value == '') {echo "$key is empty";die;} } $j = strlen($key); if ($j >= 20) {echo "Name of form element $key cannot be longer than 20 characters";die;} $j = 20 - $j; for ($i = 1; $i <= $j; $i++) {$space .= ' ';} $value = str_replace('\n', "$line", $value); $conc = "{$key}:$space{$value}$line"; $text .= $conc; $space = ' '; } mail($emailadd, $subject, $text, 'From: '.$emailadd.''); echo ''; ?>Please help! I have been struggling to make this work for a couple of weeks. It should be pretty striaght forward, right?!!!