Here, I’ve rewritten it to make it simpler:
http://ccfof.org/prayforfrance/contact/
The index.php code is below:
[code]
Name
Email
Whatcha wanna say?
[/code]
Here’s the contact.php code:
[code]
<?
// Takes posts from form and turns it into an array
$fields = $_POST;
// Makes the submit button usable again, incase the form gets stuck
unset($fields['submit']);
// Sets the filename of the DSV file
$file = "contact.csv";
// Opens the file (or error if it can't open it)
$fh = fopen($file,'a') or die("can't open file");
// Puts a quote around the commas so that they turn into columns
$delim = '","';
// Writes the commas from the line above
$csv_row = implode($delim, $fields);
// Puts a quote in front of the beginning of the first field
fwrite($fh, '"');
// Writes the data from the line above
fwrite($fh, $csv_row);
// Puts a quote at the end of the last field
fwrite($fh, '"');
// Sets up "Carriage Return Line Feed" (CRLF) (basically ENTER) or in HTML,
$crlf="rn";
// Writes the line above
fwrite($fh, $crlf);
// Closes the file
fclose($fh);
PRINT "
";
echo "
Thank you!
";
$message .= "nName: $namern
nEmail: $emailrn
nComment: $commentrn
";
$headers .= "From: $email rn";
mail("[email protected]", "Zerflin Contact Form", $message, $headers);
?>
[/code]
Does that make sense?
What am I doing wrong?