<?php

//  PROJECT HONEY POT ADDRESS DISTRIBUTION SCRIPT
//  For more information visit: http://www.projecthoneypot.org/
//  Copyright (C) 2004-2016, Unspam Technologies, Inc.
//  
//  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: Mon, 20 Jun 2016 04:12:35 -0700
//  For Domain: jacobsm.com
//  
//  

//  *** 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 ***
//  
define('__REQUEST_HOST', 'hpr6.projecthoneypot.org');
define('__REQUEST_PORT', '80');
define('__REQUEST_SCRIPT','/cgi/serve.php');
//  
//  *** FINISH CUT HERE ***
//  

define('__HPOT_TAG1',    '9cbe2db08c4ece7cc7d29fc6400cafcc');
define('__HPOT_TAG2',    '09a2d5cf6a02aed08857ef30b68f64fc');
define('__HPOT_TAG3',    '34aa2473d1aa4705f92165addfe297ff');

define('__CLASS_STYLE_1','nogolo');
define('__CLASS_STYLE_2','hixij');

define('__DIV1',         'zabr29');

define('__VANITY_L1',    'MEMBER OF PROJECT HONEY POT');
define('__VANITY_L2',    'Spam Harvester Protection Network');
define('__VANITY_L3',    'provided by Unspam');

define('__DOC_TYPE1',    '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\n');
define('__HEAD1',        '<html>\n<head>\n');
define('__HEAD2',        '<title>Jacobsm.com,hero Convincing</title>\n</head>\n');
define('__ROBOT1',       '<meta name="robots" content="follow">\n<meta name="robots" content="noindex,noarchive">\n');
define('__NOCOLLECT1',   '<meta name="no-email-collection" content="/">\n');
define('__TOP1',         '<body>\n<center>\n');
define('__EMAIL1A',      '<a href="mailto:');
define('__EMAIL1B',      '" style="display: none;">');
define('__EMAIL1C',      '</a>');
define('__EMAIL2A',      '<a href="mailto:');
define('__EMAIL2B',      '" style="display:none;">');
define('__EMAIL2C',      '</a>');
define('__EMAIL3A',      '<a style="display: none;" href="mailto:');
define('__EMAIL3B',      '">');
define('__EMAIL3C',      '</a>');
define('__EMAIL4A',      '<a style="display:none;" href="mailto:');
define('__EMAIL4B',      '">');
define('__EMAIL4C',      '</a>');
define('__EMAIL5A',      '<a href="mailto:');
define('__EMAIL5B',      '"></a>');
define('__EMAIL5C',      '..');
define('__EMAIL6A',      '<span style="display: none;"><a href="mailto:');
define('__EMAIL6B',      '">');
define('__EMAIL6C',      '</a></span>');
define('__EMAIL7A',      '<span style="display:none;"><a href="mailto:');
define('__EMAIL7B',      '">');
define('__EMAIL7C',      '</a></span>');
define('__EMAIL8A',      '<!-- <a href="mailto:');
define('__EMAIL8B',      '">');
define('__EMAIL8C',      '</a> -->');
define('__EMAIL9A',      '<div id="'.__DIV1.'"><a href="mailto:');
define('__EMAIL9B',      '">');
define('__EMAIL9C',      '</a></div><br><script language="JavaScript" type="text/javascript">document.getElementById(\''.__DIV1.'\').innerHTML=\'\';</script>');
define('__EMAIL10A',     '<a href="mailto:');
define('__EMAIL10B',     '"><!-- ');
define('__EMAIL10C',     ' --></a>');
define('__LEGAL1',       '');
define('__LEGAL2',       '\n');
define('__STYLE1',       '\n<style>a.'.__CLASS_STYLE_1.'{color:#FFF;font:bold 10px arial,sans-serif;text-decoration:none;}</style>');
define('__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');
define('__BOTTOM1',      '</center>\n</body>\n</html>\n');


function getLegalContent() { return '<table cellspacing="0" cellpadding="0" border="0">\n<tr>\n<td><font face="courier"><b><font color=white>s</font></b>&nbsp;&nbsp; <b><font color=white>s</font></b>&nbsp;&nbsp; <br>&nbsp;<br>Th&#101;<font color=white>o</font>we&#98;s<br>&#116;o &#121;ou s<br>other te<br>Website<!-- applicable fingered spriest nursing industry -->&nbsp;<br>read &#116;h<!-- levorotatory guilty highoctane majesty concession -->e<br>agents o<br>th&#101;&#109;&#46; T&#104;<br>non-tran<br>Website.<br><br>&nbsp; &nbsp; &nbsp; &nbsp; <br>&nbsp;<br>Specia&#108; <br>&#78;o&#110;-Huma<br>spiders,<br>programs<br>au&#116;&#111;mati<br><br>Email ad<br>I<!-- working totalitarian reporter -->t is r&#101;<br>a&#108;&#111;ne. Y<br>&#104;as<font color=white>g</font>a<font color=white>o</font>&#118;a<br>st&#111;r&#97;g&#101;,<br>value &#111;f<!-- largo document end closegrained correlative --><br>storin<!-- thesis -->&#103; <br>agreemen<br><br>&nbsp; <b><font color=white>p</font></b>&nbsp; &nbsp;&nbsp; <br>&nbsp;<br>Each par<br>ag&#97;ins&#116;<font color=white>a</font><br>("Judi&#99;i<br>the regi<br>su&#99;h law<br>and per&#102;<br>of feder<br>an&#121; act&#105;<br>S<!-- staircase confounded quail -->ervice.<br>&#116;he a&#98;o&#118;<br><br>&nbsp; <b><font color=white>a</font></b>&nbsp; <b><font color=white>d</font></b>&nbsp; <br><font color=white>g</font><br>Y&#111;u<font color=white>i</font>cons<br>may app&#101;<br>abuse. T<br>V&#105;sit&#111;rs<br><br>V<!-- hairy ticket excess -->I&#83;ITORS<br>PARTY OR<!-- couchant subjective delinquent unedited --><br>SUB&#83;EQUE<br></font></td>\n<td><font face="courier">&nbsp; &nbsp; &nbsp; &nbsp; <br><br>&#105;te from<br>ubject t<br>r&#109;s go&#118;&#101;<br>yo&#117; acce<br>&#109; carefu<br>&#102; the in<br>e ac&#99;&#101;s&#115;<br>sferable<br><br><br>&nbsp; &nbsp; &nbsp;&nbsp; <b>S</b><br><br>r&#101;stric&#116;<br>&#110; V&#105;s&#105;t&#111;<br>&nbsp;b&#111;ts<!-- intent sighted psychological -->, i<br>&nbsp;d&#101;s&#105;gne<br>cally<!-- weak -->.<br><br>d&#114;es&#115;es <br>cognized<br>o&#117; a<!-- downstate -->ckno<br>lue not <br>&nbsp;and/<!-- friars aesthetic arson donation -->or <br>&nbsp;these<font color=white>k</font>a<br>thi&#115; We&#98;<br>t and e<!-- transfer blue foreign -->x<br><br>&nbsp; &nbsp; &nbsp; &nbsp; <br><br>ty a<!-- handsomely recent -->&#103;re&#101;<br>&#116;he oth&#101;<br>&#97;l Actio<br>s&#116;ered<font color=white>g</font>A<br>s a&#114;e &#97;p<br>ormed en<br>al a&#110;d<font color=white>e</font>s<br>on broug<br>&nbsp;You con<br>e agreem<br><br>&nbsp; &nbsp; <b><font color=white>k</font></b>&nbsp;&nbsp; <br><br>en&#116;<font color=white>s</font>to h<br>&#97;r some&#119;<br>h&#101; I&#100;ent<br>&nbsp;agree n<br><br>&nbsp;AGREE T<br>&nbsp;SEN&#68;ING<br>N&#84; BREAC<br></font></td>\n<td><font face="courier">&nbsp; &nbsp; &nbsp; <b><font color=white>o</font><font color=white>a</font></b><br><br>&nbsp;which y<br>o<!-- transversal motor selfsealing businessman --><font color=white>k</font>the fo<br>rni&#110;g ac<br>p<!-- pigeons written multivalent -->t these<br>ll&#121;. Any<br>divid&#117;al<br>&nbsp;rights <br>&nbsp;wit&#104;&#111;ut<br><br><br><b>PECIAL</b>&nbsp;<b>L</b><br><br>ions o&#110; <br>rs. Non-<br>nde&#120;e<!-- soul -->rs,<br>d t&#111; acc<br><br><br>o&#110; &#116;his<font color=white>h</font><br><font color=white>e</font>&#116;hat &#116;h<br>wledge a<br>less &#116;ha<br>distribu<br>ddres&#115;&#101;s<br>si&#116;e\'s e<br>pressly <br><br>&nbsp; &nbsp; <b><font color=white>c</font></b>&nbsp;&nbsp; <br><br>s th&#97;t<font color=white>g</font>a<!-- cotton dirty eloquent folly --><br>r in con<br>n") shal<br>&#100;ministr<br>plied to<br>ti&#114;ely<font color=white>c</font>w<br>&#116;ate cou<br>ht agai&#110;<br>sent<font color=white>t</font>to <br>en&#116;.<br><br>&nbsp; <b><font color=white>i</font></b>&nbsp; &nbsp;&nbsp; <br><br>aving y&#111;<br>here on <br>&#105;fi&#101;r is<br>ot to us<br><br>HAT HARV<br>&nbsp;AN&#89; MES<br>H OF<font color=white>c</font>&#84;HE<br></font></td>\n<td><font face="courier">&nbsp;&nbsp; <b>TE&#82;MS</b><br><br>ou ac&#99;es<br>llowing <br>cess to <br>&nbsp;terms a<br>&nbsp;N&#111;n-Hum<br>(s) w&#104;o <br>granted<font color=white>d</font><br>&nbsp;the<font color=white>h</font>exp<br><br><br><b>ICENSE</b>&nbsp;<b>R</b><br><br>a &#118;isito<br>Human Vi<br>&nbsp;&#114;obots,<br>&#101;ss, rea<br><br><br>&#115;ite<font color=white>i</font>are<br>ese e&#109;ai<br>nd ag&#114;ee<br>n US<font color=white>t</font>$50<br>tion &#111;f <br>. Inte&#110;t<br>mail &#97;dd<br>prohib&#105;t<br><br>&nbsp;<b>&#65;P&#80;LICA</b><br><br>ny suit,<br>nectio&#110; <br>&#108; be<font color=white>a</font>gov<br>ative &#67;&#111;<br>&nbsp;agr&#101;&#101;me<br>it&#104;in th<br>rts with<br>st him i<br>electron<br><br><br><b>&#82;ECORDS<font color=white>g</font></b><br><br>ur Inter<br>this p&#97;&#103;<br>&nbsp;uni&#113;uel<br>e this a<br><br>ESTING&#44; <br>&#83;AGE(S) <br>S&#69; T&#69;RMS<br></font></td>\n<td><font face="courier">&nbsp;<b>&#65;ND</b>&nbsp;<b>&#67;ON<!-- aback minute --></b><br><br>sed t&#104;i&#115;<br>c&#111;ndit&#105;o<br>the<font color=white>h</font>Webs<br>n&#100; condi<br>an Vi&#115;&#105;t<br>controls<br>to you u<br>r&#101;&#115;s wri<br><br><br><b>ESTR&#73;CTI</b><br><br>r\'<!-- skirt sovereign contract figure -->s lic&#101;<br>s&#105;to&#114;s i<br>&nbsp;&#99;r&#97;wler<br>&#100;,<font color=white>p</font>compi<br><br><br>&nbsp;con<!-- replacement natives toxic atomic fricative -->side<br>l<!-- excited -->&nbsp;addr&#101;&#115;<br>&nbsp;&#116;hat ea<br>&#46; You<font color=white>d</font>f&#117;<br>&#116;hes<!-- building -->&#101; a&#100;<br>io&#110;al<font color=white>e</font>co<br>res&#115;es i<br>ed.<br><br><b>BLE<font color=white>k</font>LAW</b>&nbsp;<br><br>&nbsp;action <br>wi&#116;h or <br>er&#110;e&#100; b&#121;<br>ntact (t<br>nts betw<br>e &#65;dmin <br>in th&#101;<font color=white>s</font>A<br>&#110; con&#110;ec<br>i&#99; se&#114;vi<br><br><br><b>OF</b>&nbsp;<b>V&#73;SIT</b><br><br>n<!-- precision bastard hospitable claustral contempt -->et Prot<br>e (the "<br>y matche<br>&#100;dr&#101;ss &#102;<br><br>&#71;A&#84;HE&#82;IN<br>TO THE I<br>&nbsp;OF<font color=white>f</font>SERV<br></font></td>\n<td><font face="courier"><b>D&#73;&#84;ION&#83;</b>&nbsp;<br><br>&nbsp;agreeme<br>ns. The&#115;<br>ite. By <br>tions (t<br>o&#114;s to t<br>&#44; &#97;utho<!-- intravenous objective -->&#114;<br>nder the<br>t&#116;en per<br><br><br><b>ONS</b>&nbsp;<b>&#70;OR</b>&nbsp;<br><br>nse to &#97;<br>nclu&#100;e, <br>&#115;, &#104;&#97;&#114;v&#101;<br>le or ga<br><br><br>red prop<br>ses &#97;re <br>ch email<br>rther ag<br>&#100;resses <br>ll&#101;ctio&#110;<br>s recogn<br><br><br><b>AND<!-- mad fly immense eleatic parenteral --></b>&nbsp;<b>JURI</b><br><br>or p&#114;oce<br>ari&#115;in&#103; <br>&nbsp;the law<br>he<font color=white>t</font>"&#65;dmi<br>een<font color=white>h</font>A&#100;mi<br>&#83;&#116;a&#116;e.<font color=white>e</font>&#89;<br>dm<!-- smudgy barrel middlebrow coat -->in S&#116;a<br>tion wi&#116;<br>c<!-- stale -->e of pr<br><br><br><b>O&#82;</b>&nbsp;<b>USE</b>&nbsp;<b>A</b><br><br>ocol<font color=white>h</font>add<br>Identifi<br>d to<font color=white>s</font>y&#111;u<br>o&#114; any &#114;<br><br>&#71;, STORI<br>DENTIFIE<br>I&#67;E.<br></font></td>\n<td><font face="courier"><b>OF<font color=white>k</font>U&#83;E</b>&nbsp;<br><br>nt ("the<br>e term&#115; <br>vi&#115;iting<br>&#104;e "Term<br>he Websi<br>s or oth<br>&nbsp;Terms o<br>mission<!-- odd sheer unbiased -->&nbsp;<br><br><br><b>&#78;O&#78;-H&#85;M&#65;</b><br><br>ccess<font color=white>i</font>th<br>but<font color=white>f</font>&#97;r&#101; <br>sters, &#111;<br>t&#104;er con<br><br><br>rieta&#114;y<font color=white>s</font><br>provid&#101;d<br>&nbsp;a&#100;dr&#101;s&#115;<br>ree that<br>substant<br>&#44;<font color=white>d</font>harv&#101;s<br>ized &#97;s <br><br><br><b>S&#68;ICTI&#79;N</b><br><br>eding br<br>f&#114;om the<br><font color=white>d</font>of the <br>n State"<br>&#110; Stat&#101; <br>ou co&#110;se<br>te. You<font color=white>k</font><br>&#104; breach<br>oces&#115; re<br><br><br><b>ND</b>&nbsp;<b>&#65;&#66;U<!-- australian forecast confessional vatic deaf -->&#83;E</b><br><br>ress rec<br>er"&#41; if <br>r Int&#101;rn<br>eas&#111;n.<br><br>NG, TRAN<br>R CONSTI<br><br></font></td>\n<td><font face="courier"><br><br>&nbsp;Websi&#116;e<br>&#97;re in a<br>&nbsp;(in &#97;&#110;y<br>s of S&#101;r<br>te shall<br>erwis&#101; m<br>f S&#101;rvic<br>of t&#104;e o<br><br><br><b>N</b>&nbsp;<b>&#86;ISIT&#79;</b><br><br>e<font color=white>s</font>Web<!-- flock -->sit<br>not limi<br>r any ot<br>tent fr&#111;<br><br><br>intellec<br>&nbsp;&#102;or hum<br>&nbsp;the &#87;eb<br>&nbsp;th&#101; c&#111;m<br>&#105;ally di<br>t&#105;ng, ga<br>a vi&#111;l&#97;t<br><br><br>&nbsp;<br><br>ou&#103;ht by<br><font color=white>s</font>Terms o<br>sta&#116;&#101;<font color=white>i</font>&#111;f<br>) for th<br>reside&#110;t<br>nt<!-- peasant festival orthorhombic personal rhythm -->&nbsp;t&#111; th<br>&#99;&#111;&#110;&#115;ent <br>es of &#116;&#104;<br>gard<!-- strike road -->&#105;ng<font color=white>d</font><br><br><br><b><font color=white>o</font></b><br><br>orded. A<br>&#119;e suspe<br>et Proto<br><br><br>SFERRIN&#71;<br>TUTES<font color=white>p</font>AN<br><br></font></td>\n<td><font face="courier"><br><br>")<!-- washing revocatory professional homework -->&nbsp;is pr<br>ddi<!-- upward popularity knowledgeable prudish -->tion <br>&nbsp;&#109;&#97;nner&#41;<br>vice"). <br>&nbsp;be cons<br>akes use<br>&#101; are<br>wn&#101;&#114; o&#102; <br><br><br><b>RS</b>&nbsp;<br><br>e apply <br>ted<font color=white>o</font>to,<font color=white>k</font><br>her comp<br>&#109; the We<br><br><br>tual pro<br>an visit<br>site con<br>pilation<br>m&#105;ni&#115;&#104;es<br>thering,<br>ion<font color=white>o</font>o&#102; t<br><br><br><br><br>&nbsp;&#115;uch p<!-- debut dynamic cod credit orientation -->&#97;<br>f Servic<br>&nbsp;resi&#100;en<br>e Websit<br>s entere<br>e ju&#114;isd<br>to the v<br>ese &#84;e&#114;m<br>a<!-- fine doublebreasted -->ction&#115; <br><br><br><br><br>n emai&#108; <br>c&#116; pot&#101;n<br>col<font color=white>i</font>ad&#100;&#114;<br><br><br>&nbsp;&#84;O A &#84;&#72;<br>&nbsp;ACCEPTA<br><br></font></td>\n<td><font face="courier"><br><br>&#111;v&#105;ded<br>&#116;&#111;<font color=white>e</font>&#97;ny<br>&nbsp;the<br>Please<br>&#105;d&#101;red<br>&nbsp;&#111;&#102;<br><br>the<br><br><br><br><br>to<br>web<br>uter<br>bsit&#101;<br><br><br>per<!-- thanks didactic supersensitive mobile -->ty.<br>ors<br>tai&#110;s<br>,<br><font color=white>g</font>t&#104;e<br>&nbsp;and/or<br>his<br><br><br><br><br>rty<br>e<br>ce of<br>e as<br>d into<br>ictio&#110;<br>&#101;&#110;ue<font color=white>f</font>in<br>s of<br>u&#110;der<br><br><br><br><br>address<br>tial<br>&#101;ss.<br><br><br>I&#82;D<br>NCE A&#78;D<br><br></font></td>\n</tr>\n</table>\n<br>'; }


?><?php 

// 
// PROXY SUPPORT
//  
// This honey pot script supports Proxies. If your webserver requires a proxy
// for outbound connections you may configure this honey pot's settings to use
// a proxy.
//
// For more information, visit: 
//     http://www.projecthoneypot.org/settings_help.php
//
//



function formatHTML($s) {
    return str_replace('\n',"\n",$s);
}

function getDocType()       { return formatHTML(__DOC_TYPE1); }
function getHeadHTML1()     { return formatHTML(__HEAD1); }
function getRobotHTML()     { return formatHTML(__ROBOT1); }
function getNoCollectHTML() { return formatHTML(__NOCOLLECT1); }
function getHeadHTML2()     { return formatHTML(__HEAD2); }
function getTopHTML()       { return formatHTML(__TOP1); }
function getEmailHTML($method,$m) { 
    switch ($method) {
    case 0: return "";
    case 1: return formatHTML(__EMAIL1A.$m.__EMAIL1B.$m.__EMAIL1C); 
    case 2: return formatHTML(__EMAIL2A.$m.__EMAIL2B.$m.__EMAIL2C); 
    case 3: return formatHTML(__EMAIL3A.$m.__EMAIL3B.$m.__EMAIL3C); 
    case 4: return formatHTML(__EMAIL4A.$m.__EMAIL4B.$m.__EMAIL4C); 
    case 5: return formatHTML(__EMAIL5A.$m.__EMAIL5B); 
    case 6: return formatHTML(__EMAIL6A.$m.__EMAIL6B.$m.__EMAIL6C); 
    case 7: return formatHTML(__EMAIL7A.$m.__EMAIL7B.$m.__EMAIL7C); 
    case 8: return formatHTML(__EMAIL8A.$m.__EMAIL8B.$m.__EMAIL8C); 
    case 9: return formatHTML(__EMAIL9A.$m.__EMAIL9B.$m.__EMAIL9C); 
    }
    return formatHTML(__EMAIL10A.$m.__EMAIL10B.$m.__EMAIL10C); 
}
function getLegalHTML()   { return formatHTML(__LEGAL1.(getLegalContent()).__LEGAL2); }
function getStyleHTML()   { return formatHTML(__STYLE1); }
function getVanityHTML()  { return formatHTML(__VANITY1); }
function getBottomHTML()  { return formatHTML(__BOTTOM1); }

function readSettings() {
    $settings      = NULL;
    $settings_file = dirname(__FILE__)."/phpot_settings.php";

    if (is_file($settings_file) && is_readable($settings_file)) {
        $fp = fopen($settings_file,"r");
        $contents = "";
        while (!feof($fp)) {
            $contents .= fread($fp, 8192);
        }
        fclose($fp);

        $lines = explode("\n",$contents);
        foreach ($lines as $line) {
            if (trim($line) !== "") {
                list ($setting, $value) = @explode(":",$line,2);
                switch ($setting) {
                case "proxy_host": 
                    $settings["sock_host"] = trim($value);
                    break;
                case "proxy_port":
                    $settings["sock_port"] = trim($value);
                    break;
                }
                if (trim($value) !== "") {
                    $settings[trim($setting)] = trim($value);
                }
            }
        }
    }

    if (isset($settings["proxy_host"]) && isset($settings["proxy_port"]) && !isset($settings["use_proxy"])) {
        $settings["use_proxy"] = "1";
    } else {
        $settings["use_proxy"] = "0";
    }

    if (isset($settings["proxy_user"]) && isset($settings["proxy_pass"]) && !isset($settings["proxy_auth"])) {
        $settings["proxy_auth"] = "basic";
    } else {
        $settings["proxy_auth"] = "none";
    }

    if (!isset($settings["sock_host"])) $settings["sock_host"] = __REQUEST_HOST;
    if (!isset($settings["sock_port"])) $settings["sock_port"] = __REQUEST_PORT;

    return $settings;
}

function performRequest($request) {
    $response = "";

    $settings = readSettings();

    if ($settings["use_proxy"] == "1") {
        // POST via proxy
        $post_url = "http://".__REQUEST_HOST.":".__REQUEST_PORT.__REQUEST_SCRIPT;

        $head  = "POST ".$post_url." HTTP/1.0\r\n";
        //$head .= "Host: ".__REQUEST_HOST."\r\n";
        $head .= "User-Agent: PHPot ".__HPOT_TAG2."\r\n";
        if ($settings["proxy_auth"] == "basic") {
            $head .= "Proxy-Authorization: Basic ".base64_encode($settings["proxy_user"].":".$settings["proxy_pass"])."\r\n";
        }
        $head .= "Cache-Control: no-store, no-cache\r\n";
        $head .= "Accept: */*\r\n";
        $head .= "Pragma: no-cache\r\n";
        $head .= "Content-Type: application/x-www-form-urlencoded\r\n";
        $head .= "Content-Length: ".strlen($request)."\r\n";
        $head .= "Connection: close\r\n\r\n";

    } else {
        // POST directly
        $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: ".strlen($request)."\r\n";
        $head .= "Connection: close\r\n\r\n";
    }
    
    $errno  = NULL;
    $errstr = NULL;
    $fd = @fsockopen ($settings["sock_host"], $settings["sock_port"], $errno, $errstr, 20);

    if (!$fd) {
        // Socket Error
        die("\n<BR>Unable to contact the Server. Are outbound connections disabled? (If a proxy is required for outbound traffic, you may configure the honey pot to use a proxy. For instructions, visit http://www.projecthoneypot.org/settings_help.php)<BR>\n");
        return "-1";
    } else {

        fputs($fd,$head.$request);
        while(!feof($fd)) {
            $response .= fgets($fd,4096);
        }
        fclose($fd);
    }

    return $response;
}

function prepareRequest() {
    $postvars          = array();
    $postvars["tag1"]  = __HPOT_TAG1;
    $postvars["tag2"]  = __HPOT_TAG2;
    $postvars["tag3"]  = __HPOT_TAG3;
    if (!($handle = fopen(__FILE__,"r"))) {
        die("\n<BR>Unable to read contents of ".__FILE__." for hashing<BR>\n");
        return -2;
    }
    $contents = "";
    while (!feof($handle)) {
        $contents .= fread($handle, 8192);
    }
    fclose($handle);
    $postvars["tag4"]   = md5(preg_replace("/[^a-zA-Z0-9]/","",$contents));
    $postvars["ip"]    = $_SERVER["REMOTE_ADDR"];
    $postvars["svrn"]  = $_SERVER["SERVER_NAME"];  
    $postvars["svp"]   = $_SERVER["SERVER_PORT"];  
    $postvars["svip"]  = isset($_SERVER["SERVER_ADDR"]) ? $_SERVER["SERVER_ADDR"] : "";
    $postvars["rquri"]   = isset($_SERVER["REQUEST_URI"]) ? $_SERVER["REQUEST_URI"] : "";
    $postvars["phpself"] = str_replace(' ','%20',$_SERVER["PHP_SELF"]);
    $postvars["version"] = "php-".phpversion();
    $postvars["sn"]     = str_replace(' ','%20',$_SERVER["SCRIPT_NAME"]);
    $postvars["ref"]    = isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : "";
    $postvars["uagnt"]  = isset($_SERVER["HTTP_USER_AGENT"]) ? $_SERVER["HTTP_USER_AGENT"] : "";
    if (isset($_POST) && count($_POST) > 0) {
        $postvars["has_post"] = count($_POST);
        for (reset($_POST);list($k,$v) = each($_POST);) {
            $postvars["post|".$k] = $v;
        }
        reset($_POST);
    }
    if (isset($_GET) && count($_GET) > 0) {
        $postvars["has_get"] = count($_GET);
        for (reset($_GET);list($k,$v) = each($_GET);) {
            $postvars["get|".$k] = $v;
        }
        reset($_GET);
    }
    if (isset($_SERVER) && count($_SERVER) > 0) {
        $i = 0;
        for (reset($_SERVER);list($k,$v) = each($_SERVER);) {
            if ($k !== "HTTP_COOKIE" && preg_match('/^HTTP_/',$k)) {
                $postvars["header|".$k] = $v;
                $i++;
            }
        }
        $postvars["has_header"] = $i;
        reset($_SERVER);
    }

    return $postvars;
}

function transcribeResponse(& $response) {
    $settings  = NULL;
    $arr       = explode("\n",$response);
    $isParam   = FALSE;

    
    for ($i=0;list(,$v)=each($arr);$i++) {
        if ($v == "<END>")   $isParam = FALSE;

        if ($isParam) {          
            $pieces = explode("=",$v,2);
            $settings[$pieces[0]] = urldecode($pieces[1]);
        }
        if ($v == "<BEGIN>") $isParam = TRUE;
    }
    

    if (isset($settings["directives"])) {
        $settings["directives"] = explode(",",$settings["directives"]);
    }

    return $settings;
}

header("Cache-Control: no-store, no-cache");
header("Pragma: no-cache");

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

for (reset($post);list($k,$v) = each($post);) {
    $request .= "&".urlencode($k)."=".urlencode(stripslashes($v));
}
$request    = substr($request,1);
$response   = performRequest($request);
if ($response == "-1") {
    exit();
}
$settings   = transcribeResponse($response);

$directives   = $settings["directives"];
$email        = isset($settings["email"]) ? $settings["email"] : "";
$emailmethod  = isset($settings["emailmethod"]) ? $settings["emailmethod"] : 0;




?>
<?php echo (isset($directives[0]) && $directives[0]==1) ? getDocType()    : ""; ?>
<?php echo (isset($settings["injDocType"])) ? formatHTML($settings["injDocTypeMsg"]) : ""; ?>
<?php echo (isset($directives[1]) && $directives[1]==1) ? getHeadHTML1()   : ""; ?>
<?php echo (isset($settings["injHead1HTML"])) ? formatHTML($settings["injHead1HTMLMsg"]) : ""; ?>
<?php echo (isset($directives[8]) && $directives[8]==1) ? getRobotHTML()   : ""; ?>
<?php echo (isset($settings["injRobotHTML"])) ? formatHTML($settings["injRobotHTMLMsg"]) : ""; ?>
<?php echo (isset($directives[9]) && $directives[9]==1) ? getNoCollectHTML()   : ""; ?>
<?php echo (isset($settings["injNoCollectHTML"])) ? formatHTML($settings["injNoCollectHTMLMsg"]) : ""; ?>
<?php echo (isset($directives[1]) && $directives[1]==1) ? getHeadHTML2()   : ""; ?>
<?php echo (isset($settings["injHead2HTML"])) ? formatHTML($settings["injHead2HTMLMsg"]) : ""; ?>
<?php echo (isset($directives[2]) && $directives[2]==1) ? getTopHTML()    : ""; ?>
<?php echo (isset($settings["injTopHTML"])) ? formatHTML($settings["injTopHTMLMsg"]) : ""; ?>
<?php
   if (isset($settings["actMsgOn"])) { 
       echo formatHTML($settings["actMsg"]); 
   }
   if (isset($settings["errMsgOn"])) { 
       echo formatHTML($settings["errMsg"]); 
   }
   if (isset($settings["customMsgOn"])) { 
       echo formatHTML($settings["customMsg"]); 
   }
?>
<?php echo (isset($directives[3]) && $directives[3]==1) ? getLegalHTML()  : ""; ?>
<?php echo (isset($settings["injLegalHTML"])) ? formatHTML($settings["injLegalHTMLMsg"]) : ""; ?>
<?php
   if (isset($settings["altLegalOn"])) { 
       echo formatHTML($settings["altLegalMsg"]); 
   } 
?>
<?php echo (isset($directives[4]) && $directives[4]==1) ? getEmailHTML(intval($emailmethod),$email)  : ""; ?>
<?php echo (isset($settings["injEmailHTML"])) ? formatHTML($settings["injEmailHTMLMsg"]) : ""; ?>
<?php echo (isset($directives[5]) && $directives[5]==1) ? getStyleHTML()  : ""; ?>
<?php echo (isset($settings["injStyleHTML"])) ? formatHTML($settings["injStyleHTMLMsg"]) : ""; ?>
<?php echo (isset($directives[6]) && $directives[6]==1) ? getVanityHTML() : ""; ?>
<?php echo (isset($settings["injVanityHTML"])) ? formatHTML($settings["injVanityHTMLMsg"]) : ""; ?>
<?php
   if (isset($settings["altVanityOn"])) {
        echo formatHTML($settings["altVanityMsg"]);
    }
?>
<?php echo (isset($directives[7]) && $directives[7]==1) ? getBottomHTML() : ""; ?>
<?php echo (isset($settings["injBottomHTML"])) ? formatHTML($settings["injBottomHTMLMsg"]) : ""; ?>
