#!/usr/bin/perl # # Celeb Match 1.0 # &parse_form; # change web form into variables we can use &variables; # assigns variable names to questions $LogFile = "/var/www/vhosts/jokesandhumor.com/httpdocs/tests/celebsuccess.txt"; $mailprog = '/usr/sbin/sendmail'; if ($FORM{'step'} eq "") { print "Content-type: text/html\n\n"; &print_header; print qq~
Step 1 of 6

Who is the perfect celberity for you? We will now ask you a series of questions which will determine which celebrity for our extensive database that you would be the most compaitble with!

What is your name?

What is your age?

Your Gender: Male Female

You would prefer a: Male Female

~; &print_footer; } #end step 1 elsif ($FORM{'step'} eq "1") { print "Content-type: text/html\n\n"; &print_header; print qq~
Step 1 of 6

Who is the perfect celberity for you? We will now ask you a series of questions which will determine which celebrity for our extensive database that you would be the most compaitble with!

What is your name?

What is your age?

Your Gender: Male Female

You would prefer a:
Male
Female

~; &print_footer; } #end step 1 elsif ($FORM{'step'} eq "2") { print "Content-type: text/html\n\n"; &print_header; print qq~
Step 2 of 7
Okay, $hisname, we will now ask you some questions to determine the celebrity you would be most compatible with! There will be 40 quick questions, remember this test will not be accurate unless you answer the questions with 100% honestly! Have fun!
1. Your idea of a fun time?
Shopping spree Hunting or Fishing Fun in the Sun!

2. Your kind of milk?
1 or 2% Skim Milk Milk is gross!

3. How much money is in your wallet/purse right now?
Less than ten bucks Between 10 and 100 bucks More than $100 baby!

4. Do you uriniate while in the shower?
No way! Gross! Yeah, I've done it before Everytime I take a shower!

5. Would you consider yourself a "risk-taker"?
Yes, definitely I can be, once in a while No, I'm rarely ever a risk-taker

6. Do you listen to the same song over and over and over again sometimes?
Yes, some songs you just don't get sick of Very rarely Never

7. Are you an organ donor?
Yes No I am not really sure...

8. How many times have you seen the movie, "Top Gun"?
More than a few times! Good movie! Once or twice Actually, I haven't ever seen it!

~; &print_footer; } # end step 2 elsif ($FORM{'step'} eq "3") { print "Content-type: text/html\n\n"; &print_header; print qq~


Step 3 of 7
Well, $hisname, you are on your way to finding out who your love match is...!

9. Your ideal pet, if you had to choose one:
Dog Cat Snake Bird

10. Are you currently in a relationship?
Yes, married/engaged Yes, pretty serious Yes, however not serious Nope, I'm single

11. When you type on the computer:
I need to look at the keys I type while looking at the screen I'm an expert, can type more than 60 words a minute!

12. Do you wear perfume or cologne:
Yes, very often Only on very special occasions Never, or very, very rarely

13. Can you speak a foreign language?
Yes, fluently I know a little bit Nope, I can say "hello" and that's about it

14. Do you say "please" when asking someone of lesser authority to do something?
Yes No I'm not sure...

15. Have you ever done something extremely wild and out of character just to impress someone?
Nooooo way! Sure, once in a while All the time, baby!

16. An afternoon of golf would be:
A dream! A nice afternoon A Boring Afternoon

~; &print_footer; } # end step 3 elsif ($FORM{'step'} eq "4") { print "Content-type: text/html\n\n"; &print_header; print qq~
Step 4 of 7
Halfway done now, $hisname! Keep going!

17. Do you enjoy mowing the lawn?
Yes, good exercise It's okay No way, I hate it

18. Which card game would you prefer:
Poker Blackjack Euchre Go Fish

19. Do you smoke?
Yes Tried it a few times, but no Nope, never smoked

20. Have you ever drove home drunk?:
A few times Once or twice Never, or not old enough to drive

21. You primarily sleep on your:
back stomach side

22. Which would you watch?
Jeopardy! Wheel of Fortune The Price is Right

23. Your ideal match's personality would be:
Fun and Outgoing Laid back and cool Wild and spontaneous

24. You are forced to eat one of the following, which would you choose?
deer venison a corndog Veggie burger Eggplant

~; &print_footer; } # end step 4 elsif ($FORM{'step'} eq "5") { print "Content-type: text/html\n\n"; &print_header; print qq~
Step 5 of 7
$hisname, we almost have enough information to pair you with the perfect celebrity. Keep answering the questions, only a few more!

25. How do you like to dress?
Very well, dress to impress! I try to look good, but don't worry about it too much As long as it's comfortable...

26. Do you leave the water running while brushing your teeth?
Yes Sometimes No, what a waste of water

27. Can telling a lie sometimes be a good thing?
No, honesty is always best Yes, sometimes people just don't need to know Yes, lying is no big deal

28. How many TV shows do you watch regularly?
None There are one or two shows I try not to miss More than a few

29. Which historical figure do you like best?
Abe Lincoln Martin Luther King, Jr Napoleon Elvis Presley

30. Your ideal car of these choices:
BMW Hummer Truck/Jeep Lexus

31. Number of music CDs that you own:
Zero to 15 16 to 50 more than 50

32. Your significant other (or ideal significant other) cooks some spaghetti especially for you, however after tasting it, it takes awful. You would:
Eat it and act like it's good Try to hint that it's not very good Tell them flat out that it's awful

~; &print_footer; } # end step 5 elsif ($FORM{'step'} eq "6") { print "Content-type: text/html\n\n"; &print_header; print qq~
Step 6 of 7
$hisname!, you are almost done, only eight more questions to go!

33. In the morning, you prefer:
Coffee Orange Juice or Milk Hard Liquor

34. You are buying concert or sports tickets, you would rather:
spend the extra buck for great seats save money and sit in the nosebleeds

35. How many movies (rent, TV, theater) do you watch a week?
0 - 2 3 - 4 5 +

36. Which band most represents your favorite music (of these choices)?
Fleetwood Mac Dave Matthews Band Garth Brooks Outkast

37. Which issue is most important to you?
Gun control Pollution Taxes

38. Have you ever been in a fist fight?
Yes Don't think so... No

39. Your thoughts on "Hooters" restaurant:
Great place it's okay Awful place Never been there

40. How many hours of sleep did you get last night?
Between 0 and 4 hours 4 - 8 hours 9 + hours

~; &print_footer; } # end step 6 elsif ($FORM{'step'} eq "7") { print "Content-type: text/html\n\n"; &print_header; print qq~
Step 7 of 7
Generating Results for $hisname...

Before we give you your celebrity love match, we invite you to subscribe to one or more of our great free e-mail lists below:

Check boxes (if any) you wish to subscribe to:
Email:
Daily Adult Jokes Clean Jokes Word of the Day
Weekly Riddles Weekly Jokes

~; &print_footer; } # end step 7 elsif ($FORM{'step'} eq "8") { &emailforlists; $totalq = $q1 + $q2 + $q3 + $q4 + $q5 + $q6 + $q7 + $q8 + $q9 + $q10 + $q11 + $q12 + $q13 + $q14 + $q15 + $q16 + $q17 + $q18 + $q19 + $q20 + $q21 + $q22 + $q23 + $q24 + $q25 + $q26 + $q27 + $q28 + $q29 + $q30 + $q31 + $q32 + $q33 + $q34 + $q35 + $q36 + $q37 + $q38 + $q39 + $q40; $newtotal = $totalq - 123; if ($newtotal >= 0) { if ($celebgender < 30) { $yourceleb = "Michelle Pfeiffer"; $celebfile = "pfeiffer.txt";} if ($celebgender > 30) { $yourceleb = "Bill Gates"; $celebfile = "gates.txt"; } } if ($newtotal >= 15) { if ($celebgender < 30) { $yourceleb = "Oprah Winfrey"; $celebfile = "winfrey.txt"; } if ($celebgender > 30) { $yourceleb = "George Clooney"; $celebfile = "clooney.txt"; } } if ($newtotal >= 20) { if ($celebgender < 30) { $yourceleb = "Hillary Clinton"; $celebfile = "clinton.txt"; } if ($celebgender > 30) { $yourceleb = "Tim Robbins"; $celebfile = "robbins.txt"; } } if ($newtotal >= 25) { if ($celebgender < 30) { $yourceleb = "Danielle Steel"; $celebfile = "steel.txt"; } if ($celebgender > 30) { $yourceleb = "Harrison Ford"; $celebfile = "ford.txt"; } } if ($newtotal >= 30) { if ($celebgender < 30) { $yourceleb = "Jodie Foster"; $celebfile = "foster.txt"; } if ($celebgender > 30) { $yourceleb = "Tommy Lee Jones"; $celebfile = "ljones.txt"; } } if ($newtotal >= 35) { if ($celebgender < 30) { $yourceleb = "Alyson Hannigan"; $celebfile = "hannigan.txt"; } if ($celebgender > 30) { $yourceleb = "Tom Hanks"; $celebfile = "hanks.txt"; } } if ($newtotal >= 40) { if ($celebgender < 30) { $yourceleb = "Katie Holmes"; $celebfile = "holmes.txt"; } if ($celebgender > 30) { $yourceleb = "Tiger Woods"; $celebfile = "woods.txt"; } } if ($newtotal >= 45) { if ($celebgender < 30) { $yourceleb = "Faith Hill"; $celebfile = "hill.txt"; } if ($celebgender > 30) { $yourceleb = "Al Pacino"; $celebfile = "pacino.txt"; } } if ($newtotal >= 50) { if ($celebgender > 30) { $yourceleb = "Edward Furlong"; $celebfile = "furlong.txt"; } if ($celebgender < 30) { $yourceleb = "Emma Thompson"; $celebfile = "thompson.txt"; } } if ($newtotal >= 55) { if ($celebgender < 30) { $yourceleb = "Gwenyth Paltrow"; $celebfile = "paltrow.txt"; } if ($celebgender > 30) { $yourceleb = "Morgan Freeman"; $celebfile = "freeman.txt"; } } if ($newtotal >= 60) { if ($celebgender < 30) { $yourceleb = "Sandra Bullock"; $celebfile = "bullock.txt"; } if ($celebgender > 30) { $yourceleb = "Bruce Springsteen"; $celebfile = "springsteen.txt"; } } if ($newtotal >= 65) { if ($celebgender < 30) { $yourceleb = "Julia Roberts"; $celebfile = "roberts.txt"; } if ($celebgender > 30) { $yourceleb = "Ed Norton"; $celebfile = "norton.txt"; } } if ($newtotal >= 70) { if ($celebgender > 30) { $yourceleb = "Tom Cruise"; $celebfile = "cruise.txt"; } if ($celebgender < 30) { $yourceleb = "Reese Witherspoon"; $celebfile = "witherspoon.txt"; } } if ($newtotal >= 75) { if ($celebgender > 30) { $yourceleb = "Mel Gibson"; $celebfile = "gibson.txt"; } if ($celebgender < 30) { $yourceleb = "Kirsten Dunst"; $celebfile = "dunst.txt"; } } if ($newtotal >= 80) { if ($celebgender > 30) { $yourceleb = "Kevin Spacey"; $celebfile = "spacey.txt"; } if ($celebgender < 30) { $yourceleb = "Wynona Ryder"; $celebfile = "ryder.txt"; } } if ($newtotal >= 85) { if ($celebgender > 30) { $yourceleb = "Sean Penn"; $celebfile = "penn.txt"; } if ($celebgender < 30) { $yourceleb = "Natalie Portman"; $celebfile = "portman.txt"; } } if ($newtotal >= 90) { if ($celebgender > 30) { $yourceleb = "Dave Matthews"; $celebfile = "matthews.txt"; } if ($celebgender < 30) { $yourceleb = "Angelina Jolie"; $celebfile = "jolie.txt"; } } if ($newtotal >= 95) { if ($celebgender > 30) { $yourceleb = "Samuel L Jackson"; $celebfile = "ljackson.txt"; } if ($celebgender < 30) { $yourceleb = "Glenn Close"; $celebfile = "close.txt"; } } if ($newtotal >= 100) { if ($celebgender > 30) { $yourceleb = "Johnny Depp"; $celebfile = "depp.txt"; } if ($celebgender < 30) { $yourceleb = "Sheryl Swoopes"; $celebfile = "swoopes.txt"; } } if ($newtotal >= 105) { if ($celebgender < 30) { $yourceleb = "Mia Hamm"; $celebfile = "hamm.txt"; } if ($celebgender > 30) { $yourceleb = "James Van Der Beek"; $celebfile = "vanderbeek.txt"; } } if ($newtotal >= 110) { if ($celebgender > 30) { $yourceleb = "John Travolta"; $celebfile = "travolta.txt"; } if ($celebgender < 30) { $yourceleb = "Nicole Kidman"; $celebfile = "kidman.txt"; } } if ($newtotal >= 115) { if ($celebgender > 30) { $yourceleb = "Ricky Martin"; $celebfile = "martin.txt"; } if ($celebgender < 30) { $yourceleb = "Ashley Judd"; $celebfile = "judd.txt"; } } if ($newtotal >= 120) { if ($celebgender > 30) { $yourceleb = "Michael Jordan"; $celebfile = "jordan.txt"; } if ($celebgender < 30) { $yourceleb = "Anna Kournikova"; $celebfile = "kournikova.txt"; } } if ($newtotal >= 125) { if ($celebgender > 30) { $yourceleb = "Bill Murray"; $celebfile = "murray.txt"; } if ($celebgender < 30) { $yourceleb = "Jessica Alba"; $celebfile = "alba.txt"; } } if ($newtotal >= 130) { if ($celebgender > 30) { $yourceleb = "Ben Affleck"; $celebfile = "affleck.txt"; } if ($celebgender < 30) { $yourceleb = "Jennifer Lopez"; $celebfile = "lopez.txt"; } } if ($newtotal >= 135) { if ($celebgender > 30) { $yourceleb = "Brett Favre"; $celebfile = "favre.txt"; } if ($celebgender < 30) { $yourceleb = "Britney Spears"; $celebfile = "spears.txt"; } } if ($newtotal >= 140) { if ($celebgender > 30) { $yourceleb = "Nicholas Cage"; $celebfile = "cage.txt"; } if ($celebgender < 30) { $yourceleb = "LeAnn Rimes"; $celebfile = "rimes.txt"; } } if ($newtotal >= 145) { if ($celebgender > 30) { $yourceleb = "Brad Pitt"; $celebfile = "pitt.txt"; } if ($celebgender < 30) { $yourceleb = "Liv Tyler"; $celebfile = "tyler.txt"; } } if ($newtotal >= 150) { if ($celebgender > 30) { $yourceleb = "Val Kilmer"; $celebfile = "kilmer.txt"; } if ($celebgender < 30) { $yourceleb = "Sarah Michelle Gellar"; $celebfile = "gellar.txt"; } } if ($newtotal >= 155) { if ($celebgender > 30) { $yourceleb = "Joe Pesci"; $celebfile = "pesci.txt"; } if ($celebgender < 30) { $yourceleb = "Tiffany Amber Thiessen"; $celebfile = "thiessen.txt"; } } if ($newtotal >= 160) { if ($celebgender > 30) { $yourceleb = "Sylvester Stallone"; $celebfile = "stallone.txt"; } if ($celebgender < 30) { $yourceleb = "Cameron Diaz"; $celebfile = "diaz.txt"; } } if ($newtotal >= 165) { if ($celebgender > 30) { $yourceleb = "Justin Timberlake"; $celebfile = "timberlake.txt"; } if ($celebgender < 30) { $yourceleb = "Christina Aguilera"; $celebfile = "aguilera.txt"; } } if ($newtotal >= 170) { if ($celebgender > 30) { $yourceleb = "Trent Reznor"; $celebfile = "reznor.txt"; } if ($celebgender < 30) { $yourceleb = "Geri Halliwell"; $celebfile = "halliwell.txt"; } } if ($newtotal >= 175) { if ($celebgender > 30) { $yourceleb = "Nelly"; $celebfile = "nelly.txt"; } if ($celebgender < 30) { $yourceleb = "Jennifer Aniston"; $celebfile = "aniston.txt"; } } if ($newtotal >= 180) { if ($celebgender > 30) { $yourceleb = "Eminem"; $celebfile = "eminem.txt"; } if ($celebgender < 30) { $yourceleb = "Melissa Joan Hart"; $celebfile = "hart.txt"; } } if ($newtotal >= 185) { if ($celebgender > 30) { $yourceleb = "Mark Wahlberg"; $celebfile = "wahlberg.txt"; } if ($celebgender < 30) { $yourceleb = "Janet Jackson"; $celebfile = "jackson.txt"; } } if ($newtotal >= 190) { if ($celebgender > 30) { $yourceleb = "Chris Rock"; $celebfile = "rock.txt"; } if ($celebgender < 30) { $yourceleb = "Carmen Electra"; $celebfile = "electra.txt"; } } if ($newtotal >= 195) { if ($celebgender > 30) { $yourceleb = "Mike Tyson"; $celebfile = "tyson.txt"; } if ($celebgender < 30) { $yourceleb = "Catherine Zeta Jones"; $celebfile = "jones.txt"; } } if ($newtotal >= 200) { if ($celebgender > 30) { $yourceleb = "Ted Nugent"; $celebfile = "nugent.txt"; } if ($celebgender < 30) { $yourceleb = "Rose McGowan"; $celebfile = "mcgowan.txt"; } } if ($newtotal >= 205) { if ($celebgender > 30) { $yourceleb = "Marilyn Manson"; $celebfile = "manson.txt"; } if ($celebgender < 30) { $yourceleb = "Drew Barrymore"; $celebfile = "barrymore.txt"; } } open (CELEB, ") { $celebinfo .= $_; } close CELEB; print "Content-type: text/html\n\n"; &print_header; print qq~


Celebrity Love Match Results for: $hisname
Your Celebrity Match is: $yourceleb

$celebinfo
~; &get_date; open (COUNT,">>$LogFile"); print COUNT "$date2|$hisname|$age|$email|$gender|$celebgender|$location|$newtotal|$q1|$q2|$q3|$q4|$q5|$q6|$q7|$q8|$q9|$q10|$q11|$q12|$q13|$q14|$q15|$q16|$q17|$q18|$q19|$q20|$q21|$q22|$q23|$q24|$q25|$q26|$q27|$q28|$q29|$q30|$q31|$q32|$q33|$q34|$q35|$q36|$q37|$q38|$q39|$q40|$yourceleb\n"; close (COUNT); print qq~
MAKE YOUR FRIENDS TAKE THIS!

You can now:

~; &print_footer; # # # START COUNTER STUFF # $data_dir = "/var/www/vhosts/jokesandhumor.com/httpdocs/tests/"; $auto_create = "1"; $lock_sec = "3"; # Print Content Type Header For Browser #### print "Content-type: text/html\n\n"; # Get the page location from the DOCUMENT_URI environment variable. #$count_page = "$ENV{'DOCUMENT_URI'}"; $count_page = "CELEB.txt"; # Any characters that are not letters or numbers are turned into an underscore # $count_page =~ s/[^\w]/_/g; $lock_file = "$count_page\.lock"; # Check to see if file is locked by program already in use. &check_lock($lock_sec); # If the file exists, get the date and count out of it. Otherwise, if # auto_create is allowed, create a new account. If neither of these are # true, return an error. if (-e "$data_dir$count_page") { open(COUNT,"$data_dir$count_page"); $line = ; chop($line) if $line =~ /\n$/; close(COUNT); ($date,$count) = split(/\|\|/,$line); } elsif ($auto_create == 1) { &create; } else { &error('page_not_found'); } # Increment Count. $count++; $print_count = $count; # Get Count Length for use in padding. $count_length = length($count); # Print the Count, Link and Date depending on what user has specified # they wish to print. #if ($show_date == 1) { # if ($show_link =~ /http:\/\//) { # #} #else { # print "$print_count hits since $date"; #} #} #else { # if ($show_link =~ /http:\/\//) { # print "$print_count"; #} #else { # print "$print_count"; #} #} # Open the count file and write the new count that has been incremented. open(COUNT,">$data_dir$count_page") || &error('could_not_increment'); print COUNT "$date\|\|$count"; close(COUNT); # Remove Lock File for next time script is run on that HTML page. &clean_up; sub create { ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); @months = ("January","February","March","April","May","June","July", "August","September","October","November","December"); $year += 1900; $date = "$months[$mon] $mday, $year"; $count = "0"; open(COUNT,">$data_dir$count_page") || &error('count_not_created'); print COUNT "$date\|\|$count"; close(COUNT); } sub error { $error = shift(@_); if ($error eq 'page_not_found') { print "[TextCounter Fatal Error: This Page Not Found\; Auto-Create Option Disabled]"; } elsif ($error eq 'bad_uri') { print "[TextCounter Fatal Error: This Page Not In Valid URI]"; } elsif ($error eq 'count_not_created') { print "[TextCounter Fatal Error: Could Not Write to File $datadir$count_page]"; } elsif ($error eq 'could_not_increment') { print "[TextCounter Fatal Error: Could Not Increment Counter]"; } exit; } sub check_lock { $time = $_[0]; for ($i = 1;$i <= $time; $i++) { if (-e "$data_dir$lock_file") { sleep 1; } else { open(LOCK,">$data_dir$lock_file"); print LOCK "0"; close(LOCK); last; } } } sub clean_up { unlink("$data_dir$lock_file"); } # # END COUNTER STUFF # # } # end step 8 # # # VARIABLES, Etc # sub variables { if ($FORM{'hisname'}) { $hisname = "$FORM{'hisname'}"; $hisname =~ s/"//g; $hisname =~ s///g; $hisname =~ s/\&//g; } if ($FORM{'age'}) { $age = "$FORM{'age'}"; } if ($FORM{'email'}) { $email = "$FORM{'email'}"; } if ($FORM{'gender'}) { $gender = "$FORM{'gender'}"; } if ($FORM{'celebgender'}) { $celebgender = "$FORM{'celebgender'}"; } if ($FORM{'location'}) { $location = "$FORM{'location'}"; } if ($FORM{'q1'}) { $q1= "$FORM{'q1'}"; } if ($FORM{'q2'}) { $q2= "$FORM{'q2'}"; } if ($FORM{'q3'}) { $q3= "$FORM{'q3'}"; } if ($FORM{'q4'}) { $q4= "$FORM{'q4'}"; } if ($FORM{'q5'}) { $q5= "$FORM{'q5'}"; } if ($FORM{'q6'}) { $q6= "$FORM{'q6'}"; } if ($FORM{'q7'}) { $q7= "$FORM{'q7'}"; } if ($FORM{'q8'}) { $q8= "$FORM{'q8'}"; } if ($FORM{'q9'}) { $q9= "$FORM{'q9'}"; } if ($FORM{'q10'}) { $q10= "$FORM{'q10'}"; } if ($FORM{'q11'}) { $q11= "$FORM{'q11'}"; } if ($FORM{'q12'}) { $q12= "$FORM{'q12'}"; } if ($FORM{'q13'}) { $q13= "$FORM{'q13'}"; } if ($FORM{'q14'}) { $q14= "$FORM{'q14'}"; } if ($FORM{'q15'}) { $q15= "$FORM{'q15'}"; } if ($FORM{'q16'}) { $q16= "$FORM{'q16'}"; } if ($FORM{'q17'}) { $q17= "$FORM{'q17'}"; } if ($FORM{'q18'}) { $q18= "$FORM{'q18'}"; } if ($FORM{'q19'}) { $q19= "$FORM{'q19'}"; } if ($FORM{'q20'}) { $q20= "$FORM{'q20'}"; } if ($FORM{'q30'}) { $q30= "$FORM{'q30'}"; } if ($FORM{'q21'}) { $q21= "$FORM{'q21'}"; } if ($FORM{'q22'}) { $q22= "$FORM{'q22'}"; } if ($FORM{'q23'}) { $q23= "$FORM{'q23'}"; } if ($FORM{'q24'}) { $q24= "$FORM{'q24'}"; } if ($FORM{'q25'}) { $q25= "$FORM{'q25'}"; } if ($FORM{'q26'}) { $q26= "$FORM{'q26'}"; } if ($FORM{'q27'}) { $q27= "$FORM{'q27'}"; } if ($FORM{'q28'}) { $q28= "$FORM{'q28'}"; } if ($FORM{'q29'}) { $q29= "$FORM{'q29'}"; } if ($FORM{'q40'}) { $q40= "$FORM{'q40'}"; } if ($FORM{'q31'}) { $q31= "$FORM{'q31'}"; } if ($FORM{'q32'}) { $q32= "$FORM{'q32'}"; } if ($FORM{'q33'}) { $q33= "$FORM{'q33'}"; } if ($FORM{'q34'}) { $q34= "$FORM{'q34'}"; } if ($FORM{'q35'}) { $q35= "$FORM{'q35'}"; } if ($FORM{'q36'}) { $q36= "$FORM{'q36'}"; } if ($FORM{'q37'}) { $q37= "$FORM{'q37'}"; } if ($FORM{'q38'}) { $q38= "$FORM{'q38'}"; } if ($FORM{'q39'}) { $q39= "$FORM{'q39'}"; } if ($FORM{'recipient'}) { $recipient= "$FORM{'recipient'}"; } if ($FORM{'recipient2'}) { $recipient2= "$FORM{'recipient2'}"; } if ($FORM{'recipient3'}) { $recipient3= "$FORM{'recipient3'}"; } if ($FORM{'recipient4'}) { $recipient4= "$FORM{'recipient4'}"; } if ($FORM{'recipient5'}) { $recipient5= "$FORM{'recipient5'}"; } if ($FORM{'recipient6'}) { $recipient6= "$FORM{'recipient6'}"; } if ($FORM{'recipient7'}) { $recipient7= "$FORM{'recipient7'}"; } if ($FORM{'recipient8'}) { $recipient8= "$FORM{'recipient8'}"; } } # end sub variables sub parse_form { local($name,$value); # Get the input read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); # Split the name-value pairs @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); # Un-Webify plus signs and %-encoding $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; # Remove any NULL characters, Server Side Includes $value =~ s/\0//g; $value =~ s///g; if ($allow_html != 1) { $value =~ s/<([^>]|\n)*>//g; } else { unless ($name eq 'body') { $value =~ s/<([^>]|\n)*>//g; } } $FORM{$name} = $value; } } sub print_header { open (HEAD, ") { $heading .= $_; } close HEAD; open (SIDE, ") { $sidebar .= $_; } close SIDE; open (BOTTOM, ") { $bottom .= $_; } close BOTTOM; print qq~ Celebrity Love Match $heading ~; #$ADVNoPrint = 1; # $ADVQuery = ""; # require "/home/virtual/site2/fst/var/www/cgi-bin/ads.pl"; # end of print header } #end of sub print_header sub print_footer { print qq~

$bottom ~; } #end of sub print_footer sub emailforlists { if ($recipient) { open(MAIL,"|$mailprog -t"); print MAIL "To: join-jokesandhumor\@list.netatlantic.com\n"; print MAIL "From: $email ($hisname)\n"; # Check for Message Subject print MAIL "Subject: SUBSCRIBE\n\n"; print MAIL "Subscribe Me\n"; print MAIL "($email) on $date\n"; print MAIL "-" x 75 . "\n\n"; } # end recipient if ($recipient2) { open(MAIL,"|$mailprog -t"); print MAIL "To: jokesandhumorweekly-subscribe\@topica.com\n"; print MAIL "From: $email ($hisname)\n"; # Check for Message Subject print MAIL "Subject: SUBSCRIBE\n\n"; print MAIL "Subscribe Me\n"; print MAIL "($email) on $date\n"; print MAIL "-" x 75 . "\n\n"; } # end recipient if ($recipient3) { open(MAIL,"|$mailprog -t"); print MAIL "To: hotbabedaily-subscribe\@topica.com\n"; print MAIL "From: $email ($hisname)\n"; # Check for Message Subject print MAIL "Subject: SUBSCRIBE\n\n"; print MAIL "Subscribe Me\n"; print MAIL "($email) on $date\n"; print MAIL "-" x 75 . "\n\n"; } # end recipient if ($recipient4) { open(MAIL,"|$mailprog -t"); print MAIL "To: riddlesjh-subscribe\@topica.com\n"; print MAIL "From: $email ($hisname)\n"; # Check for Message Subject print MAIL "Subject: SUBSCRIBE\n\n"; print MAIL "Subscribe Me\n"; print MAIL "($email) on $date\n"; print MAIL "-" x 75 . "\n\n"; } # end recipient if ($recipient5) { open(MAIL,"|$mailprog -t"); print MAIL "To: jokesandhumorclean-subscribe\@topica.com\n"; print MAIL "From: $email ($hisname)\n"; # Check for Message Subject print MAIL "Subject: SUBSCRIBE\n\n"; print MAIL "Subscribe Me\n"; print MAIL "($email) on $date\n"; print MAIL "-" x 75 . "\n\n"; } # end recipient if ($recipient6) { open(MAIL,"|$mailprog -t"); print MAIL "To: wordofthedayjh-subscribe\@topica.com\n"; print MAIL "From: $email ($hisname)\n"; # Check for Message Subject print MAIL "Subject: SUBSCRIBE\n\n"; print MAIL "Subscribe Me\n"; print MAIL "($email) on $date\n"; print MAIL "-" x 75 . "\n\n"; } # end recipient if ($recipient7) { open(MAIL,"|$mailprog -t"); print MAIL "To: drinksjh-subscribe\@topica.com\n"; print MAIL "From: $email ($hisname)\n"; # Check for Message Subject print MAIL "Subject: SUBSCRIBE\n\n"; print MAIL "Subscribe Me\n"; print MAIL "($email) on $date\n"; print MAIL "-" x 75 . "\n\n"; } # end recipient if ($recipient8) { open(MAIL,"|$mailprog -t"); print MAIL "To: freebiesjh-subscribe\@topica.com\n"; print MAIL "From: $email ($hisname)\n"; # Check for Message Subject print MAIL "Subject: SUBSCRIBE\n\n"; print MAIL "Subscribe Me\n"; print MAIL "($email) on $date\n"; print MAIL "-" x 75 . "\n\n"; } # end recipient } # end subroutine sub get_date { # Define arrays for the day of the week and month of the year. # @days = ('Sunday','Monday','Tuesday','Wednesday', 'Thursday','Friday','Saturday'); @months = ('January','February','March','April','May','June','July', 'August','September','October','November','December'); # Get the current time and format the hour, minutes and seconds. Add # # 1900 to the year to get the full 4 digit year. # ($sec,$min,$hour,$mday,$mon,$year,$wday) = (localtime(time))[0,1,2,3,4,5,6]; $time = sprintf("%02d:%02d:%02d",$hour,$min,$sec); $year += 1900; $mon2 = $mon + 1; # Format the date. # $date = "$days[$wday], $months[$mon] $mday, $year at $time"; $date2 = "$mon2/$mday/$year"; }