ฃ่วยหน่อยครับติดerror โค้ดส่งemailอะครับ ผมลองทำตามวีดีโอละไม่ได้อะครับช่วยหน่อยบางโค้ดผมก็ตัดออกบางบรรทัด
keyform.htm
<body>
<form action="contact-us-send.php" method="post">
<ul>
<li>
<label for="name">Your Name</label>
<input id="name" type="text" name="name" />
</li>
<li>
<label for="email">Your Email</label>
<input id="email" type="text" name="email" />
</li>
<li>
<label for="comment">Your Name</label>
<textarea id="comment" name="comment"></textarea>
</li>
<li>
<input id="submit" type="submit" name="submit"
value="Click to Send Comments" />
</li>
</ul>
</form>
</body>
contact-us-send.php
<body>
<?
// submitted to server through form
// build the email message by using
// info received by the HTML form
if(isset($_POST['submit'])){
$msg = 'Name: ' .$_POST['name'] ."\n"
.'Email: ' .$_POST['email'] ."\n"
.'Comment: ' ."\n" .$_POST['comment'];
// send email using PHP's built in
// command, mail()
mail('example@example.com',
'Sample Comments', $msg);
// redirect to the thank you page
header('location: contact-us-thank-you.html');
}else{
header('localtion: keyform.html');
// exit this script - just to make sure nothing else gets run
exit(0);
}
?>
</body>
error Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\AppServ\www\sqigroup_new\contact-us-send.php on line 22
Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\sqigroup_new\contact-us-send.php:9) in C:\AppServ\www\sqigroup_new\contact-us-send.php on line 25
ฃ่วยหน่อยครับติดerror โค้ดส่งemailอะครับ
keyform.htm
<body>
<form action="contact-us-send.php" method="post">
<ul>
<li>
<label for="name">Your Name</label>
<input id="name" type="text" name="name" />
</li>
<li>
<label for="email">Your Email</label>
<input id="email" type="text" name="email" />
</li>
<li>
<label for="comment">Your Name</label>
<textarea id="comment" name="comment"></textarea>
</li>
<li>
<input id="submit" type="submit" name="submit"
value="Click to Send Comments" />
</li>
</ul>
</form>
</body>
contact-us-send.php
<body>
<?
// submitted to server through form
// build the email message by using
// info received by the HTML form
if(isset($_POST['submit'])){
$msg = 'Name: ' .$_POST['name'] ."\n"
.'Email: ' .$_POST['email'] ."\n"
.'Comment: ' ."\n" .$_POST['comment'];
// send email using PHP's built in
// command, mail()
mail('example@example.com',
'Sample Comments', $msg);
// redirect to the thank you page
header('location: contact-us-thank-you.html');
}else{
header('localtion: keyform.html');
// exit this script - just to make sure nothing else gets run
exit(0);
}
?>
</body>
error Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\AppServ\www\sqigroup_new\contact-us-send.php on line 22
Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\sqigroup_new\contact-us-send.php:9) in C:\AppServ\www\sqigroup_new\contact-us-send.php on line 25