#!/usr/bin/perl
#BwkejKAi2hjklasdkl230aiojWERMNqwekn2kASK2jalasjhbeqm2bnash(www.joesapt.net)

#  PROJECT HONEY POT ADDRESS DISTRIBUTION SCRIPT
#  For more information visit: http://www.projecthoneypot.org/
#  Copyright (C) 2004, Unspam, LLC
#  
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#  
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#  
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
#  02111-1307  USA
#  
#  If you choose to modify or redistribute the software, you must
#  completely disconnect it from the Project Honey Pot Service, as
#  specified under the Terms of Service Use. These terms are available
#  here:
#  
#  http://www.projecthoneypot.org/terms_of_service_use.php
#  
#  The required modification to disconnect the software from the
#  Project Honey Pot Service is explained in the comments below. To find the
#  instructions, search for:  *** DISCONNECT INSTRUCTIONS ***
#  
#  Generated On: Tue, 22 Feb 2005 14:38:28 -0600
#  For Domain: www.joesapt.net
#  
#  
use strict;
use Digest::MD5 qw(md5_hex);



#  *** DISCONNECT INSTRUCTIONS ***
#  
#  You are free to modify or redistribute this software. However, if
#  you do so you must disconnect it from the Project Honey Pot Service.
#  To do this, you must delete the lines of code below located between the
#  *** START CUT HERE *** and *** FINISH CUT HERE *** comments. Under the
#  Terms of Service Use that you agreed to before downloading this software,
#  you may not recreate the deleted lines or modify this software to access
#  or otherwise connect to any Project Honey Pot server.
#  
#  *** START CUT HERE ***
#  
my $__REQUEST_HOST    = 'hpr9.projecthoneypot.org';
my $__REQUEST_PORT    = '80';
my $__REQUEST_SCRIPT  = '/cgi/serve.php';
#  
#  *** FINISH CUT HERE ***
#  

my $__HPOT_TAG1       = '2ebb885d3583d3432e435ba4262f6b14';
my $__HPOT_TAG2       = '14d5514d6f91c0d74579ce208a49311a';
my $__HPOT_TAG3       = 'c808d526685dc5b8610e1c9d31236792';

my $__CLASS_STYLE_1   = 'gopochehucra';
my $__CLASS_STYLE_2   = 'stajusteb';

my $__DIV1            = '1ac7suw5tr85';

my $__VANITY_L1       = 'MEMBER OF PROJECT HONEY POT';
my $__VANITY_L2       = 'Spam Harvester Protection Network';
my $__VANITY_L3       = 'provided by Unspam';

my $__DOC_TYPE1       = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\n';
my $__HEAD1           = '<html>\n<head>\n';
my $__HEAD2           = '<title>Www.joesapt.net:cagey</title>\n</head>\n';
my $__ROBOT1          = '<meta name="robots" content="noarchive,follow">\n<meta name="robots" content="noindex">\n';
my $__NOCOLLECT1      = '<meta name="no-email-collection" content="/" />\n';
my $__TOP1            = '<body>\n<div align="center" id="ringed">\n';
my $__EMAIL1A         = '<a href="mailto:';
my $__EMAIL1B         = '" style="display: none;">';
my $__EMAIL1C         = '</a>';
my $__EMAIL2A         = '<a href="mailto:';
my $__EMAIL2B         = '" style="display:none;">';
my $__EMAIL2C         = '</a>';
my $__EMAIL3A         = '<a style="display: none;" href="mailto:';
my $__EMAIL3B         = '">';
my $__EMAIL3C         = '</a>';
my $__EMAIL4A         = '<a style="display:none;" href="mailto:';
my $__EMAIL4B         = '">';
my $__EMAIL4C         = '</a>';
my $__EMAIL5A         = '<a href="mailto:';
my $__EMAIL5B         = '"></a>';
my $__EMAIL5C         = '..';
my $__EMAIL6A         = '<span style="display: none;"><a href="mailto:';
my $__EMAIL6B         = '">';
my $__EMAIL6C         = '</a></span>';
my $__EMAIL7A         = '<span style="display:none;"><a href="mailto:';
my $__EMAIL7B         = '">';
my $__EMAIL7C         = '</a></span>';
my $__EMAIL8A         = '<!-- <a href="mailto:';
my $__EMAIL8B         = '">';
my $__EMAIL8C         = '</a> -->';
my $__EMAIL9A         = '<div id="'.$__DIV1.'"><a href="mailto:';
my $__EMAIL9B         = '">';
my $__EMAIL9C         = '</a></div><br><script language="JavaScript" type="text/javascript">document.getElementById(\''.$__DIV1.'\').innerHTML=\'\';</script>';
my $__EMAIL10A        = '<a href="mailto:';
my $__EMAIL10B        = '"><!-- ';
my $__EMAIL10C        = ' --></a>';
my $__LEGAL1          = '';
my $__LEGAL2          = '\n';
my $__STYLE1          = '\n<style>a.'.$__CLASS_STYLE_1.'{color:#FFF;font:bold 10px arial,sans-serif;text-decoration:none;}</style>';
my $__VANITY1         = '<table cellspacing="0"cellpadding="0"border="0"style="background:#999;width:230px;"><tr><td valign="top"style="padding: 1px 2px 5px 4px;border-right:solid 1px #CCC;"><span style="font:bold 30px arial,sans-serif;color:#666;top:0px;position:relative;">@</span></td><td valign="top" align="left" style="padding:3px 0 0 4px;"><a href="http://www.projecthoneypot.org/" class="'.$__CLASS_STYLE_1.'">'.$__VANITY_L1.'</a><br><a href="http://www.unspam.com"class="'.$__CLASS_STYLE_1.'">'.$__VANITY_L2.'<br>'.$__VANITY_L3.'</a></td></tr></table>\n';
my $__BOTTOM1         = '</div>\n</body>\n</html>\n';


sub getLegalContent() { return '<table cellpadding="0" border="0" cellspacing="0"><tr>\n<td><tt>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <b><font color=white>f</font></b>&nbsp;<br>&nbsp;<br>The websi&#116;e<font color=white>a</font>fro&#109;<br>t&#111; &#121;ou &#115;ubject t<br>other terms g&#111;ve<br>Website<font color=white>s</font>y&#111;u acce<br>r&#101;&#97;d the&#109; carefu<br>agents of the in<br>t&#104;em. The access<br>no&#110;-tran&#115;ferable<br>&#87;&#101;bsit&#101;.<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <b><font color=white>f</font></b>&nbsp;&nbsp; <b>&#83;</b><br>&nbsp;<br>Special restrict<br>Non-H&#117;man Visito<br>spiders, bo&#116;s&#44; i<br>p&#114;&#111;grams designe<br>automati&#99;ally.<br><br>Emai&#108; addresse&#115;<font color=white>t</font><br>It is recognized<br>&#97;lone. You ackno<br>has a va&#108;ue &#110;ot <br>stor&#97;ge, a&#110;d/or <br>val&#117;e &#111;f &#116;he&#115;e a<br>s&#116;oring &#116;his W&#101;b<br>agreemen&#116; and ex<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>&nbsp;<br>Eac&#104; pa&#114;t&#121; ag&#114;ee<br>against t&#104;e othe<br>("Judicial A&#99;tio<br>the regi&#115;tered A<br>such &#108;a&#119;s are ap<br>and perform&#101;d en<br>of fe&#100;e&#114;al and<font color=white>d</font>&#115;<br>any a&#99;tion broug<br>Se&#114;vic&#101;. Y&#111;u c&#111;n<br>the &#97;bove agreem<br><br><b><font color=white>t</font></b>&nbsp; <b><font color=white>c</font></b>&nbsp; &nbsp; &nbsp;&nbsp; <b><font color=white>f</font><font color=white>d</font><font color=white>e</font></b>&nbsp; <br>&nbsp;<br>You co&#110;sent to h<br>may appear s&#111;mew<br>abuse&#46; &#84;he Ident<br>Vi&#115;itors ag&#114;ee &#110;<br><br>VISIT&#79;&#82;S AGREE T<br>PART&#89;<font color=white>c</font>OR S&#69;ND&#73;NG<br>SUBS&#69;QUENT BREAC<br></tt></td>\n<td><tt><b><font color=white>i</font></b>&nbsp;&nbsp; <b><font color=white>i</font></b>&nbsp; &nbsp; &nbsp; <b>TER&#77;S</b><br><br>&nbsp;whic&#104; &#121;ou acces<br>o the follo&#119;&#105;ng <br>r&#110;i&#110;&#103; access to <br>pt thes&#101; terms a<br>&#108;ly. &#65;ny No&#110;-Hum<br>dividual(s)<font color=white>s</font>wh&#111; <br>&nbsp;rights granted <br>&nbsp;witho&#117;t the exp<br><br><br><b>PECIAL</b>&nbsp;<b>LICENSE</b>&nbsp;<b>R</b><br><br>ions on a visito<br>rs. Non-&#72;uman Vi<br>n&#100;exers, robo&#116;&#115;,<br>d to a&#99;cess, rea<br><br><br>on<font color=white>d</font>this<font color=white>o</font>sit&#101; a&#114;e<br>&nbsp;&#116;hat these e&#109;ai<br>wledge and agree<br>l&#101;s&#115; &#116;&#104;an US $50<br>distribu&#116;i&#111;n of<font color=white>f</font><br>ddresses. Intent<br>&#115;&#105;te\'s email add<br>pressl&#121; prohibit<br><br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <b>APPLI&#67;&#65;</b><br><br>s<font color=white>e</font>that &#97;ny &#115;&#117;it&#44;<br>r in &#99;onn&#101;ction <br>n") &#115;hall &#98;e gov<br>dministrative Co<br>plied &#116;o agr&#101;eme<br>t&#105;r&#101;ly with&#105;n<font color=white>t</font>t&#104;<br>tat&#101; cou&#114;ts w&#105;th<br>ht a&#103;&#97;inst him i<br>sent to electron<br>ent&#46;<br><br>&nbsp; <b><font color=white>f</font></b>&nbsp;&nbsp; <b><font color=white>c</font></b>&nbsp;<b>&#82;E&#67;O&#82;DS<font color=white>h</font></b><br><br>av&#105;n&#103; your Inter<br>here on this pa&#103;<br>ifier is<font color=white>d</font>&#117;&#110;iquel<br>ot<font color=white>d</font>to use this a<br><br>HA&#84;<font color=white>o</font>HAR&#86;ESTING&#44;<font color=white>k</font><br>&nbsp;ANY MESS&#65;GE(S) <br>H &#79;F T&#72;ESE<font color=white>f</font>TE&#82;MS<br></tt></td>\n<td><tt>&nbsp;<b>AND</b>&nbsp;<b>CON&#68;I&#84;IONS</b>&nbsp;<br><br>sed this agreeme<br>con&#100;itions. Thes<br>the Web&#115;&#105;te.<font color=white>d</font>By <br>nd conditions (t<br>an Visi&#116;ors to t<br>con&#116;rols, author<br>to you unde&#114; the<br>ress written p&#101;r<br><br><br><b>ESTRICTIONS</b>&nbsp;<b>FOR</b>&nbsp;<br><br>r\'s license t&#111; a<br>sit&#111;rs &#105;&#110;clude, <br>&nbsp;craw&#108;ers,<font color=white>f</font>har&#118;e<br>d,<font color=white>i</font>compile o&#114; ga<br><br><br>&nbsp;considere&#100; pro&#112;<br>l &#97;ddresses are<font color=white>p</font><br>&nbsp;th&#97;&#116; each e&#109;ai&#108;<br>. You further ag<br>&#116;he&#115;e a&#100;dres&#115;&#101;s <br>io&#110;al &#99;ollectio&#110;<br>resses i&#115; &#114;ecogn<br>ed.<br><br><b>BLE</b>&nbsp;<b>LA&#87;</b>&nbsp;<b>&#65;&#78;D</b>&nbsp;<b>J&#85;RI</b><br><br>&nbsp;a&#99;tio&#110; or proce<br>with or<font color=white>k</font>arising <br>erned by the &#108;&#97;w<br>ntact (t&#104;e "Admi<br>n&#116;s<font color=white>i</font>&#98;e&#116;w&#101;en Ad&#109;i<br>e &#65;dmin State. &#89;<br>i&#110; the &#65;dmin &#83;ta<br>&#110; con&#110;e&#99;tion wit<br>ic serv&#105;ce &#111;f pr<br><br><br><b>OF</b>&nbsp;<b>VISITOR</b>&nbsp;<b>US&#69;<font color=white>k</font>A</b><br><br>net Protocol add<br>e (the "Identif&#105;<br>y ma&#116;ched to you<br>ddress &#102;or any r<br><br>GA&#84;HERIN&#71;, &#83;TORI<br>TO THE IDENTIFIE<br>&nbsp;OF SERVI&#67;E.<br></tt></td>\n<td><tt><b>OF<font color=white>d</font>&#85;&#83;E<font color=white>d</font></b><br><br>nt &#40;"the Website<br>e &#116;erms<font color=white>p</font>are in a<br>visitin&#103; (in any<br>he "Terms<font color=white>a</font>of Ser<br>he Website &#115;ha&#108;l<br>&#115;<font color=white>k</font>o&#114; othe&#114;wis&#101; &#109;<br>&nbsp;Te&#114;ms<font color=white>p</font>o&#102; Servic<br>mis&#115;ion of th&#101; o<br><br><br><b>&#78;O&#78;-&#72;UMA&#78;<font color=white>t</font>VISITO</b><br><br>cce&#115;s th&#101; Websit<br>but are &#110;ot<font color=white>k</font>limi<br>s&#116;ers, or any ot<br>ther &#99;on&#116;ent fro<br><br><br>rietary i&#110;&#116;e&#108;lec<br>provid&#101;d for h&#117;m<br>&nbsp;addr&#101;ss the Web<br>ree that t&#104;e com<br>substantia&#108;l&#121; di<br>,<font color=white>p</font>harv&#101;st&#105;ng, ga<br>i&#122;ed as a violat<br><br><br><b>SD&#73;&#67;TION<font color=white>i</font></b><br><br>eding<font color=white>f</font>b&#114;&#111;&#117;&#103;ht by<br>from t&#104;e Terms<font color=white>t</font>o<br>&nbsp;of th&#101; state<font color=white>e</font>of<br>&#110; State"&#41;<font color=white>c</font>for &#116;h<br>n State r&#101;si&#100;ent<br>o&#117; co&#110;sent to th<br>te. You consen&#116; <br>h<font color=white>t</font>br&#101;ache&#115; of th<br>oc&#101;ss reg&#97;rding <br><br><br><b>ND</b>&nbsp;<b>AB&#85;SE</b>&nbsp;<br><br>res&#115; &#114;ec&#111;rded. A<br>er") if we s&#117;spe<br>r I&#110;t&#101;rn&#101;t Proto<br>eason.<br><br>NG, &#84;&#82;&#65;N&#83;FER&#82;ING<br>&#82; CONSTITUTES &#65;N<br><br></tt></td>\n<td><tt><br><br>") is provided<br>ddit&#105;&#111;n<font color=white>t</font>to any<br>&nbsp;manne&#114;) th&#101;<br>vice"). Please<br>&nbsp;b&#101; cons&#105;de&#114;ed<br>a&#107;es use of<br>e are<br>wner of the<br><br><br><b>RS</b>&nbsp;<br><br>e apply to<br>ted to, web<br>her computer<br>m the Website<br><br><br>tual property.<br>&#97;n visitors<br>&#115;ite &#99;ont&#97;ins<br>pilation&#44;<br>mi&#110;ishes the<br>the&#114;ing, a&#110;&#100;/or<br>io&#110;<font color=white>a</font>of this<br><br><br><br><br>&nbsp;su&#99;h part&#121;<br>f<font color=white>a</font>Se&#114;vice<br>&nbsp;r&#101;si&#100;e&#110;ce of<br>e We&#98;sit&#101; as<br>s entered into<br>e jurisdic&#116;&#105;on<br>to the ven&#117;e i&#110;<br>&#101;&#115;e Terms<font color=white>o</font>of<br>acti&#111;ns &#117;nder<br><br><br><br><br>n ema&#105;l a&#100;dress<br>ct<font color=white>h</font>pot&#101;ntial<br>col a&#100;dr&#101;ss.<br><br><br>&nbsp;T&#79; A THIRD<br>&nbsp;ACCEPTANCE AND<br><br></tt></td>\n</tr>\n</table>\n<br>'; }




sub formatHTML		{
	my $s = $_[0];
	$s =~ s/\\n/\n/g;
	return $s;
}
sub getDocType			{ return formatHTML($__DOC_TYPE1); }
sub getHeadHTML			{ return formatHTML($__HEAD1); }
sub getRobotHTML		{ return formatHTML($__ROBOT1); }
sub getNoCollectHTML	{ return formatHTML($__NOCOLLECT1); }
sub getHeadHTML2		{ return formatHTML($__HEAD2); }
sub getTopHTML			{ return formatHTML($__TOP1); }
sub getEmailHTML		{
	my $method=$_[0];
	my $m=$_[1];
	if ($method eq "0" || !$method) {
		return "";
	} elsif ($method eq "1") {
		return formatHTML($__EMAIL1A.$m.$__EMAIL1B.$m.$__EMAIL1C);
	} elsif ($method eq "2") {
		return formatHTML($__EMAIL2A.$m.$__EMAIL2B.$m.$__EMAIL2C);
	} elsif ($method eq "3") {
		return formatHTML($__EMAIL3A.$m.$__EMAIL3B.$m.$__EMAIL3C);
	} elsif ($method eq "4") {
		return formatHTML($__EMAIL4A.$m.$__EMAIL4B.$m.$__EMAIL4C);
	} elsif ($method eq "5") {
		return formatHTML($__EMAIL5A.$m.$__EMAIL5B);
	} elsif ($method eq "6") {
		return formatHTML($__EMAIL6A.$m.$__EMAIL6B.$m.$__EMAIL6C);
	} elsif ($method eq "7") {
		return formatHTML($__EMAIL7A.$m.$__EMAIL7B.$m.$__EMAIL7C);
	} elsif ($method eq "8") {
		return formatHTML($__EMAIL8A.$m.$__EMAIL8B.$m.$__EMAIL8C);
	} elsif ($method eq "9") {
		return formatHTML($__EMAIL9A.$m.$__EMAIL9B.$m.$__EMAIL9C); 
	}
	return formatHTML($__EMAIL9A.$m.$__EMAIL9B.$m.$__EMAIL9C);
}
sub getLegalHTML	{
	my $legal_text = &getLegalContent;
	return formatHTML($__LEGAL1.($legal_text).$__LEGAL2);
}
sub getStyleHTML	{ return formatHTML($__STYLE1); }
sub getVanityHTML	{ return formatHTML($__VANITY1); }
sub getBottomHTML	{ return formatHTML($__BOTTOM1); }

sub performRequest {
	
	my $request = $_[0];
	my $response = "";
	my $head = "";
	
        $head  = "POST ".$__REQUEST_SCRIPT." HTTP/1.1\r\n";
        $head .= "Host: ".$__REQUEST_HOST."\r\n";
        $head .= "User-Agent: PHPot ".$__HPOT_TAG2."\r\n";
        $head .= "Content-Type: application/x-www-form-urlencoded\r\n";
        $head .= "Content-Length: ".length($request)."\r\n";
        $head .= "Connection: close\r\n\r\n";

	use Socket;

	socket(SH, PF_INET, SOCK_STREAM, getprotobyname('tcp')) || die $!;
	my $sin = sockaddr_in($__REQUEST_PORT,inet_aton($__REQUEST_HOST));
	connect(SH,$sin) || die "\n<br>Unable to contact the server...<br>\n";
	syswrite(SH, $head, length($head));	
	syswrite(SH, $request, length($request));	
	my $line;
	while ($line = <SH>) {
		$response .= $line;
	}
	
	close(SH);
	return $response;
}

sub prepareRequest {
    my %postvars		= ();
    $postvars{"tag1"}	= $__HPOT_TAG1;
    $postvars{"tag2"}	= $__HPOT_TAG2;
    $postvars{"tag3"}	= $__HPOT_TAG3;
    if ($ENV{"SCRIPT_FILENAME"}) {
        $postvars{"tag4"}   = md5_hex(&file_get_contents(&basename($ENV{"SCRIPT_FILENAME"}))); 
    } else {
        $postvars{"tag4"}   = md5_hex(&file_get_contents(&basename($ENV{"PATH_TRANSLATED"}))); 
    }

    $postvars{"ip"}		= $ENV{"REMOTE_ADDR"};

	$postvars{"svrn"}	= $ENV{"SERVER_NAME"};
	
	$postvars{"svp"}	= $ENV{"SERVER_PORT"};

	$postvars{"svip"}	= $ENV{"SERVER_ADDR"};

	$postvars{"rquri"}	= $ENV{"REQUEST_URI"};
	
	$postvars{"sn"}		= $ENV{"SCRIPT_NAME"};
	$postvars{"sn"}		=~ s/ /%20/g;
	
	$postvars{"ref"}   = $ENV{"HTTP_REFERER"};
	
	$postvars{"uagnt"} = $ENV{"HTTP_USER_AGENT"};
	
    return %postvars;
}

sub transcribeResponse {
	my $response	= $_[0];
	my %settings	= ();
	my @directives	= ();
	my @arr			= split("\n",$response);
	my $isParam		= 0;

   
   	my $i = 0;
    
	foreach my $v (@arr) {
   		if ($v eq "<END>") { $isParam	= 0; }

        if ($isParam) {          
            my @pieces 					= split("=",$v,2);
            $settings{$pieces[0]}		= &urldecode($pieces[1]);
        }
        if ($v eq "<BEGIN>") { $isParam	= 1; }
	}
    

    if ($settings{"directives"}) {

        @directives		= split(",",$settings{"directives"});
    }

    return \(@directives,%settings);
}

print "Content-Type: text/html\n";
print "Cache-Control: no-cache\n\n";

my $response  	= "";
my $request		= "";
my %post      	= prepareRequest();

foreach my $k (keys %post) {
    $request .= "&$k=".&urlencode(&stripslashes($post{$k}));
}

$request    = substr($request,1);
$response   = performRequest($request);

if ($response == "-1") {
    exit();
}

my ($directives_ref,$settings_ref)   = transcribeResponse($response);

my @directives = @$directives_ref;
my %settings = %$settings_ref;

my $email        = $settings{"email"};
my $emailmethod  = $settings{"emailmethod"};


if ($directives[0] eq "1") { print getDocType(); }
if ($settings{"injDocType"}) { print $settings{"injDocTypeMsg"}; }
if ($directives[1] eq "1") { print getHeadHTML(); }
if ($settings{"injHead1HTML"}) { print $settings{"injHead1HTMLMsg"}; }
if ($directives[8] eq "1") { print getRobotHTML(); }
if ($settings{"injRobotHTML"}) { print $settings{"injRobotHTMLMsg"}; }
if ($directives[9] eq "1") { print getNoCollectHTML(); }
if ($settings{"injNoCollectHTML"}) { print $settings{"injNoCollectHTMLMsg"}; }
if ($directives[1] eq "1") { print $settings{"injHead2HTMLMsg"}; }
if ($settings{"injHead2HTML"}) { print $settings{"injHead2HTMLMsg"}; }
if ($directives[2] eq "1") { print getTopHTML(); }
if ($settings{"injTopHTML"}) { print $settings{"injTopHTMLMsg"}; }
if ($settings{"actMsgOn"}) { print $settings{"actMsg"}; }
if ($settings{"errMsgOn"}) { print $settings{"errMsg"}; }
if ($settings{"customMsgOn"}) { print $settings{"customMsg"}; }
if ($directives[3] eq "1") { print getLegalHTML(); }
if ($settings{"injLegalHTML"}) { print $settings{"injLegalHTMLMsg"}; }
if ($settings{"altLegalOn"}) { print $settings{"altLegalMsg"}; }

if ($directives[4] eq "1") { print getEmailHTML($emailmethod,$email); }
if ($settings{"injEmailHTML"}) { print $settings{"injEmailHTMLMsg"}; }
if ($directives[5] eq "1") { print getStyleHTML(); }
if ($settings{"injStyleHTML"}) { print $settings{"injStyleHTMLMsg"}; }
if ($directives[6] eq "1") { print getVanityHTML(); }
if ($settings{"injVanityHTML"}) { print $settings{"injVanityHTMLMsg"}; }

if ($settings{"altVanityOn"}) { print $settings{"altVanityMsg"}; }

if ($directives[7] eq "1") { print getBottomHTML(); }
if ($settings{"injBottomHTML"}) { print $settings{"injBottomHTMLMsg"}; }


#################### PERL <-> PHP functions ################

sub file_get_contents {
	open(FILE, "< $_[0]") or die "can't open $_[0]: $!";
	undef $/;
	my $whole_file = <FILE>;               # 'slurp' mode
	$whole_file =~ s/^#![a-zA-Z0-9\/\\\:\.\-\_\~ ]*[\n\r;]//;
	close(FILE);
	return $whole_file;
}

sub basename {

	return $_[0];
}

sub urldecode {
    my $theURL = $_[0];
    $theURL =~ tr/+/ /;
    $theURL =~ s/%([a-fA-F0-9]{2,2})/chr(hex($1))/eg;
    $theURL =~ s/<!--(.|\n)*-->//g;
    return $theURL;
}

sub urlencode {
	my $theURL = $_[0];
	$theURL =~ s/([\W])/"%" . uc(sprintf("%2.2x",ord($1)))/eg;
	return $theURL;
}

sub stripslashes {

	return $_[0];
}
