Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can anyone help? Part II

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
#!/data1/hm/harmani.com/cgi-bin/form.cgi
&get_form_data();
&send_email;
&print_thankyou_paga;
sub get_form_data
{

#Get the input

read(STDIN, $buffer,$ENV{'Content_Length'} );

#Split the name-value pairs
@parirs=split(/&/, $buffer);
foreach $pair (@paris)

{

($name, $value)=split(/=/, $pair);
#Un-Webify plus signs and %-encoding

$value=~tr/+/ /;
$value=~s/%[a-fA-FO-9][a-fA-FO-9])/pack("C",
hex($!))/eg;
$value=~s/<!--(.|\n)*-->//g;
$FORM($name)=$value;
}
}
sub send_email
{
$to=&quot;ceo\@harmani.com&quot;;
open(MAIL, &quot;/var/qmail/bin/qmail-inject -t $to&quot;) || die
(&quot;can't open sendmail&quot;);
print MAIL &quot;From: $FORM{'email'}\n&quot;;
print MAIL &quot;To: $to\n&quot;;
print MAIL &quot;Subject: Form submission\n\n&quot;;
# print out the form results
print MAIL &quot;Name: $FORM{'Name1'}\n&quot;;
print MAIl &quot;Title: $FORM{'Title'}\n;
print MAIL &quot;E-mail: $FORM{'Email'}\n;
print MAIL &quot;Address: $FORM{'Address'}\n;
print MAIL &quot;Gender: $FORM{'Gender'}\n;
print MAIL &quot;Age: $FORM{'Age}\n;
print MAIL &quot;Date of Birth: $FORM{'DOB'}\n;
print MAIL &quot;How did you find out about Harmani?: $FORM{'Info1'}\n;
print MAIL &quot;What is it that you like about Harmani?: $FORM{'Info2'}\n;
print MAIL &quot;What would you like to see improved at Harmani?: $FORM{'Comment'}\n;
close (MAIL);
}
sub print_thankyou_page
{
print &quot;Content-type: text/html\n\n&quot;;
print &quot;<HTML>\n<HEAD>\n<BODY BGCOLOR=\&quot;#FFFF99\&quot;>\n
</HEAD>&quot;;
print &quot;<H3>Thank you</H3>\n\n&quot;;
print &quot;<P>\n&quot;;
print &quot;Thank you for your submission\n&quot;;
print &quot;<P>\n&quot;;
print &quot;<A HREF=\&quot; the home page\n&quot;;
}
print &quot;</BODY<\n</HTML>&quot;;
 
So, what exactly is the question?


keep the rudder amid ship and beware the odd typo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top