[JaxPM] RE: Code
CGR Online
cgronline at jaxcan.org
Fri Dec 1 16:37:05 CST 2000
On the jacksonville-pm-list; Jax.PM'er CGR Online <cgronline at jaxcan.org> wrote -
Okay I'm lost. I can't seem to figure what's wrong. I'm getting the all
too popular script headers but can pin point it to exactly where. Any
ideas?
#!/usr/bin/perl -w
use CGI;
use FileHandle;
$cgiobject = new CGI;
$from = $cgiobject -> param ("from");
$email = $cgiobject -> param ("email");
$subject = $cgiobject -> param ("subject");
$body = $cgiobject -> param ("body");
$htmlprint = "Content-type: Text/html\n\n";
# first let me see if this user exists
unless (-e "/path/$from")
{
mkdir ("/path/$from", 0777) || die ("$!\n");
chdir ("/path/$from");
$fh = new FileHandle "> datafile";
$mode = 0777; chmod $mode, 'datafile';
}
print "$htmlprint";
print "<HTML><BODY BGCOLOR=\"BLACK\" TEXT=\"WHITE\">";
print "The following message has been sent:<BR>";
print "To: $email<BR>";
print "Subject: $subject<BR>";
print "$body";
print "</BODY></HTML>";
open (MAIL, "|/usr/lib/sendmail -oi $email");
print MAIL "Reply-to: $from\n\n";
print MAIL "Subject : $subject\n\n";
print MAIL "$body\n";
close (MAIL);
open (DATA, ">>/path/$from/datafile") || die
("Can not open file because ... $!");
print DATA "To - $email\n";
print DATA "Subject - $subject\n";
print DATA "\t\t$body\n\n";
close (MAIL);
I know it's a simple script but i'm just learning
PS(Thanx bill for the heads up)
---
Sir Anvil
www.christiangamers.org
Jax.PM Moderator's Note:
This message was posted to the Jacksonville Perl Monger's Group listserv.
The group manager can be reached at -- owner-jacksonville-pm-list at pm.org
to whom send all praises, complaints, or comments...
More information about the Jacksonville-pm
mailing list