มือใหม่สุดๆกับการทำฟอร์มทูเมล์ครั้งแรก ผมลองทำแล้วมันไม่ทำงานนะครับ ใครพอช่วยบอกทีนะครับว่าผมไปทำผิดตรงไหนเนี่ย
ตรงนี้ผมเขียน html ไว้อย่างนี้นะครับ<form action="http://fusion.dns-systems.net/cgi-bin/Form.cgi" method="post">
<input type="hidden" name="recipient" value="abc@abc.com">
<p><span class="style103">Name :</span>
<input name="name" type="text" size="45">
</p>
<p><span class="style103">Email :</span> <input name="email" type="text" size="45"> </p>
<p class="style102">Your Order Items or Your Suggestions: </p>
<p>
<textarea name="order" cols="60" rows="7"></textarea> </p>
<p><input name="" type="submit" value="SEND"> </p>
</form>
ตรงนี้ที่ server ผมใช้ แบบนี้นะครับ#!/usr/bin/perl -wT
use CGI qw(:standard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use strict;
print header;
print start_htm("Results");
# Set the PATH environment variable to the same path
# where sendmail is located:
$ENV{PATH} = "/usr/sbin";
# open the pipe to sendmail
open (MAIL, "|/usr/sbin/sendmail -oi -t") or
&dienice("Can't fork for sendmail: $!\n");
# change this to your own e-mail address
my $recipient = 'abc@abc.com';
# Start printing the mail headers
# You must specify who it's to, or it won't be delivered:
print MAIL "To: $recipient\n";
# From should probably be the webserver.
print MAIL "From: nobody\@abc.com\n";
# print a subject line so you know it's from your form cgi.
print MAIL "Subject: Form Data\n\n";
# Now print the body of your mail message.
foreach my $p (param()) {
print MAIL "$p = ", param($p), "\n";
}
# Be sure to close the MAIL input stream so that the
# message actually gets mailed.
close(MAIL);
# Now print a thank-you page
print <<EndHTM;
<h2>Thank You</h2>
<p>Thank you for writing!</p>
<p>Return to our <a href="index.htm">home page</a>.</p>
EndHTM
print end_htm;
# The dienice subroutine handles errors.
sub dienice {
my($errmsg) = @_;
print "<h2>Error</h2>\n";
print "<p>$errmsg</p>\n";
print end_htm;
exit;
}
สรุปมันไปผิดตรงไหนเนี่ยครับ ToT ขอบคุณล่วงหน้าเลยครับสำหรับทุกท่านที่ช่วยตอบ
**** ความรู้ในการเขียนนี่มั่วมาจากการหาใน google จนจะหมดแรงละครับ แต่อยากให้ให้สำเร็จจนได้นะครับ****