Jump to content

Puzzling Form


benjancewicz

Recommended Posts

I'm a bit baffled...I have this form, duplicated on two hosting servers.One is here: http://www.zerflin.us/labs/contact.htmlOne is here: http://barakdrama.org/contact.htmlThe code is exactly the same (written out below), but one works and the other doesn't. Any ideas?THE FORM:

 <form action="contact.php" method="post" class=""><fieldset><p>  <input name="firstname" type="text" class="textfield"  id="firstname"  />  First Name<p>  <input name="lastname" type="text" class="textfield"  id="lastname"  /> Last Name<p>  <input name="address" type="text" class="textfield"  id="address"  /> Address<p>  <input name="city" type="text" class="textfield"  id="city"  /> City<p>  <input name="state" type="text" class="textfield"  id="state"  /> State<p>  <input name="zipcode" type="text" class="textfield"  id="zipcode"  /> Zip Code<p>  <input name="phone" type="text" class="textfield"  id="phone"  /> Phone<p>  <input name="email" type="text" class="textfield" id="email" /> Email<p>Comment<p><textarea cols="30" rows="15" name="comment" id="comment"></textarea><input name="submit" type="submit" class="submit" id="submit" value="submit" /></fieldset></form>

THE PHP:

<?// Takes posts from form and turns it into an array$fields = $_POST;// Makes the submit button usable again, incase the form gets stuckunset($fields['submit']);// Sets the filename of the DSV file$file = "output.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 fieldfwrite($fh, '"');// Writes the data from the line abovefwrite($fh, $csv_row);// Puts a quote at the end of the last fieldfwrite($fh, '"');// Sets up "Carriage Return Line Feed" (CRLF) (basically ENTER) or in HTML, <br>$crlf="\r\n";// Writes the line abovefwrite($fh, $crlf);// Closes the filefclose($fh); PRINT "<p>";echo "<center>Thank you!	  </center>";$message .= "\nFirst Name: $firstname\r\n\nLast Name: $lastname\r\n\nAddress: $address\r\n\nCity: $city\r\n\nState: $state\r\n\nZip Code: $zipcode\r\n\nPhone: $phone\r\n\nEmail: $email\r\n\nComment: $comment\r\n\nLineBreak: $crlf\r\n";$headers .= "From: $email <$email>\r\n";mail("benjancewicz@zerflin.com", "Barak Contact Form", $message, $headers);?>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...