Hi, I´m Kind of new trying to add a contact form to a Web Page, I don´t know too much about programming so I tried to make it using this kirupa´s tutorial:
http://www.kirupa.com/web/php_contact_form4.htm
I understood it and followed every step, I uploaded the files I´ve generated to the site and I made some tests, in the browser (Safari), When I Click Submit, in the contact.html file, appears the mailer.php file with the next message:
“Data has been submitted to christian8513@hotmail.com!
Warning: mail() [function.mail]: “sendmail_from” not set in php.ini or custom “From:” header missing in I:\FerozoWebHosting\celltrack.com.mx\public_html\mailer.php on line 19”
So I think something’s wrong because i´ve tried with a pair of e-mail adresses in the code and nothing happened, haven’t received nothing, I hope someone can help me, the codes used are these:
FOR THE CONTACT FILE
<html>
<head>
<meta http-equiv=“Content-Language” content=“en-us”>
<meta http-equiv=“Content-Type” content=“text/html; charset=windows-1252”>
<title>New Page 1</title>
</head>
<body>
<form method=“POST” action=“mailer.php”>
Name:
<input type=“text” name=“name” size=“19”><br>
<br>
E-Mail:
<input type=“text” name=“email” size=“19”><br>
<br>
<input type="checkbox" name="check[]" value="blue_color"> Blue<br>
<input type="checkbox" name="check[]" value="green_color"> Green<br>
<input type="checkbox" name="check[]" value="orange_color"> Orange<br>
<br>
<input type="radio" value="yes" name="radio"> YES<br>
<input type="radio" value="no" name="radio"> NO
<br>
<br>
<select size="1" name="drop_down">
<option>php</option>
<option>xml</option>
<option>asp</option>
<option>jsp</option>
</select><br>
<br>
Message:<br>
<textarea rows="9" name="message" cols="30"></textarea><br>
<br>
<input type="submit" value="Submit" name="submit">
</form>
</body>
</html>
AND FOR THE MAILER FILE:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=“http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=“Content-Type” content=“text/html; charset=ISO-8859-1” />
<title>Untitled Document</title>
</head>
<body><?php
if(isset($_POST[‘submit’])) {
$to = "christian8513@hotmail.com";
$subject = “Form Cellular Track”;
$name_field = $_POST[‘name’];
$email_field = $_POST[‘email’];
$message = $_POST[‘message’];
$body = “From: $name_field
E-Mail: $email_field
Message:
$message”;
echo “Data has been submitted to $to!”;
mail($to, $subject, $body);
} else {
echo “blarg!”;
}
?>
</body>
</html>
THANK YOU VERY MUCH YOU GUYS!!