Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

cecil36's scratchpad

by cecil36 (Pilgrim)
on Jun 01, 2004 at 22:03 UTC ( #358603=scratchpad: print w/replies, xml ) Need Help??

#!/usr/bin/perl # &readparse; print "Content-type: text/html\n\n"; # #********* BEGIN BODY******************** $to=''; $from=$MyEmail; $subject="Online Prayer Request from $MyName"; $text=" Dear JUMC Prayer Team, I bring the name of $PrayerRecipientName to the attention to the Lord. + A description of my prayer request is below. $PrayerRequest"; if $PrayerCardYes eq "Yes" { $text=$text." Please send a prayer card to $PrayerRecipientName. Their address +is: $Name $Address $City".", "."$State $ZipPlus4" }; &email($to,$from,$subject,$text); #Code to print web page removed. Not concerned about it yet. #******** END BODY************************ # # EACH VALUE IN THE HTML FORM WILL BE CONTAINED IN # THE THE @VALUE ARRAY. sub readparse { read(STDIN,$user_string,$ENV{'CONTENT_LENGTH'}); if (length($ENV{'QUERY_STRING'})>0) {$user_string=$ENV{'QUERY_STRING'} +}; $user_string =~ s/\+/ /g; @name_value_pairs = split(/&/,$user_string); foreach $name_value_pair (@name_value_pairs) { ($keyword,$value) = split(/=/,$name_value_pair); $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/ge; push(@value, "$value"); $user_data{$keyword} = $value; if ($value=~/<!--\#exec/) { print "Content-type: text/html\n\nNo SSI permitted"; exit; }; }; }; #E-MAIL SUBROUTINE #ADD "&email(to,from,subject,text)" TO YOUR SCRIPT #REMEMBER TO BACKSLASH THE @ WHEN YOU ARE NOT USING IT IN AN ARRAY #FOR EXAMPLE: # $to='robyoung\'; # $from='foo\'; # $subject='Thank you for your inquiry'; # $text='Dear reader\n\nThank you for your recent inquiry.'; # &email($to,$from,$subject,$text); sub email { local($to,$from,$sub,$letter) = @_; $to=~s/@/\@/; $from=~s/@/\@/; open(MAIL, "|/usr/sbin/sendmail -t") || die "Content-type: text/text\n\nCan't open /usr/sbin/sendmail!"; print MAIL "To: $to\n"; print MAIL "From: $from\n"; print MAIL "Subject: $sub\n"; print MAIL "$letter\n"; return close(MAIL); }
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2023-12-02 01:39 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (13 votes). Check out past polls.