<?php

//  PROJECT HONEY POT ADDRESS DISTRIBUTION SCRIPT
//  For more information visit: http://www.projecthoneypot.org/
//  Copyright (C) 2004-2012, 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, 19 Mar 2012 01:47:10 -0700
//  For Domain: www.meulie.net
//  
//  

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

define('__HPOT_TAG1',    'db129b4662640760a712527fbb7cc19c');
define('__HPOT_TAG2',    'f1a899ce8401e8567d6b7a411f449165');
define('__HPOT_TAG3',    '34aa2473d1aa4705f92165addfe297ff');

define('__CLASS_STYLE_1','bruw');
define('__CLASS_STYLE_2','vochiswu');

define('__DIV1',         'chapr4');

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>Stiffnecked Mineral www.meulie.net</title>\n</head>\n');
define('__ROBOT1',       '<meta name="robots" content="follow,noarchive,noindex">\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 cellpadding="0" border="0" cellspacing="0">\n<tr>\n<td><font style="font-family: courier, monospace;">&nbsp;&nbsp; <b><font color="#FFFFFF">g</font></b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>&nbsp;<br>The &#119;ebsite from<br>&#116;o &#121;&#111;u s&#117;&#98;&#106;ect t<br>&#111;the&#114; te&#114;m<!-- reply immigration -->s &#103;ove<br>Websit&#101; y&#111;u a&#99;c&#101;<br>read t&#104;em &#99;are&#102;u<br>agen&#116;s of the in<br>th&#101;&#109;.<font color="#FFFFFF">h</font>&#84;he ac&#99;ess<br>n&#111;n&#45;transferab&#108;&#101;<br>Website.<br><br>&nbsp; &nbsp; &nbsp; <b><font color="#FFFFFF">t</font></b>&nbsp; &nbsp; &nbsp; &nbsp; <b>S</b><br>&nbsp;<br>Special restri&#99;t<br>&#78;on-Hum&#97;&#110; Visito<br>spider&#115;, bot&#115;, i<br>programs designe<br>aut<!-- edge tear attribute radical -->&#111;mati&#99;&#97;lly.<br><br>&#69;mail<!-- making tavern lie fatal -->&nbsp;&#97;ddr&#101;sses <br>It is recognized<br>alone. You ackno<br>ha&#115; a v&#97;lue not <br>s&#116;o&#114;age, and/or <br>valu&#101; of these a<br>sto&#114;in&#103; t&#104;is Web<br>agreement a&#110;d<font color="#FFFFFF">e</font>&#101;&#120;<br><br>&nbsp;&nbsp; <b><font color="#FFFFFF">i</font><font color="#FFFFFF">c</font></b>&nbsp;<b><font color="#FFFFFF">o</font></b>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <br>&nbsp;<br>Each p&#97;rty agre&#101;<br>again&#115;t the othe<br>("Judici<!-- serpentine offshore respectable big arcuate -->al Actio<br>&#116;he re&#103;istered<font color="#FFFFFF">h</font>A<br>such &#108;aw&#115; are<font color="#FFFFFF">g</font>a&#112;<br>and performed en<br>of federa&#108; and s<br>any ac&#116;ion<font color="#FFFFFF">s</font>brou&#103;<br>S&#101;rvice. Yo&#117; co<!-- bright fine compatible modular -->n<br>&#116;he abo&#118;e<font color="#FFFFFF">k</font>&#97;greem<br><br>&nbsp;<b><font color="#FFFFFF">k</font></b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br><font color="#FFFFFF">p</font><br>Yo&#117; &#99;onse&#110;t to<font color="#FFFFFF">a</font>h<br>may &#97;ppear &#115;omew<br>abuse. The I&#100;ent<br>V&#105;si&#116;ors<font color="#FFFFFF">i</font>agree n<br><br>&#86;&#73;SITORS A&#71;REE T<br>PA&#82;TY<font color="#FFFFFF">s</font>OR S&#69;NDING<br>S<!-- security -->&#85;&#66;SEQ&#85;ENT B&#82;EAC<br></font></td>\n<td><font style="font-family: courier, monospace;">&nbsp; &nbsp; &nbsp; &nbsp; <b><font color="#FFFFFF">k</font></b>&nbsp; <b>T&#69;&#82;MS</b><br><br>&nbsp;which &#121;&#111;u acces<br>o the followi&#110;g <br>rnin<!-- routine freefloating acid money -->g<font color="#FFFFFF">f</font>access<font color="#FFFFFF">d</font>to <br>pt &#116;he&#115;&#101; t&#101;rms a<br>l&#108;y. Any Non-&#72;&#117;m<br>dividual(&#115;) who <br>&nbsp;ri&#103;hts grante<!-- circular fool spiders centripetal barrel -->d <br>&nbsp;without th&#101; e&#120;p<br><br><br><b>PECIAL</b>&nbsp;<b>LICENSE</b>&nbsp;<b>R</b><br><br>io&#110;s on a visito<br>rs. &#78;on-H&#117;ma&#110;<font color="#FFFFFF">i</font>Vi<br>ndexers&#44; &#114;obots,<br>d to ac&#99;e&#115;s,<!-- liaison romanesque -->&nbsp;&#114;&#101;a<br><br><br>on this site ar&#101;<br>&nbsp;that &#116;hese emai<br>wl&#101;dge an&#100; agree<br>less &#116;han &#85;S $50<br>distrib&#117;tion<!-- procumbent chapel -->&nbsp;of <br>ddresses. In&#116;ent<br>&#115;ite\'s &#101;mail add<br>press<!-- irreverent -->ly prohib&#105;t<br><br>&nbsp; &nbsp;&nbsp; <b><font color="#FFFFFF">p</font></b>&nbsp; <b><font color="#FFFFFF">h</font>AP&#80;LICA</b><br><br>s that any suit,<br>r i&#110; connection <br>&#110;") &#115;hall be gov<br>&#100;ministrat&#105;ve &#67;o<br>plied t&#111; a&#103;ree&#109;e<br>tirely within &#116;h<br>tate<font color="#FFFFFF">s</font>c&#111;ur&#116;&#115; &#119;ith<br>&#104;t against<font color="#FFFFFF">i</font>him i<br>sen&#116; to electron<br>e&#110;t.<br><br>&nbsp; &nbsp;&nbsp; <b><font color="#FFFFFF">i</font></b>&nbsp; <b>REC&#79;RDS</b>&nbsp;<br><br>avin<!-- true spriest scrawny lap beginning -->g your I&#110;ter<br>here on t<!-- unpleasant fat -->&#104;is &#112;&#97;g<br>ifie&#114; &#105;s<font color="#FFFFFF">o</font>un&#105;q&#117;el<br>ot to &#117;se this a<br><br>HAT HARVESTING, <br><font color="#FFFFFF">a</font>ANY M&#69;S<!-- spicy liar pleasure medieval -->SAGE(S) <br>H OF THESE<font color="#FFFFFF">h</font>TE&#82;MS<br></font></td>\n<td><font style="font-family: courier, monospace;">&nbsp;<b>AND</b>&nbsp;<b>CONDITI&#79;NS<font color="#FFFFFF">h</font></b><br><br>se&#100; this agr<!-- echoic terminal -->e&#101;me<br>condi&#116;io&#110;&#115;&#46; T&#104;es<br>the Websit<!-- spiritual relaxed pepper -->e. By <br>&#110;d co&#110;ditions<font color="#FFFFFF">i</font>(t<br>an Visi&#116;ors to t<br>controls, author<br>to you unde&#114; &#116;he<br>ress writte&#110;<font color="#FFFFFF">a</font>pe&#114;<br><br><br><b>ESTR<!-- landscape province -->ICTIONS</b>&nbsp;<b>FOR</b>&nbsp;<br><br>r\'s lic&#101;n&#115;e to a<br>s&#105;tors i<!-- ants longdrawnout putrid -->nc&#108;ude, <br>&nbsp;crawl&#101;rs, harv&#101;<br>d, comp&#105;le or ga<br><br><br>&nbsp;considered pro<!-- psychotic isomorphic -->p<br>l addr&#101;ss&#101;s are<font color="#FFFFFF">d</font><br>&nbsp;that ea<!-- red spoken warmup hoarse ad -->ch emai<!-- pillow charity northeast allure nip -->l<!-- wolf diluvial --><br>. &#89;ou<font color="#FFFFFF">p</font>further ag<br>th&#101;se<!-- dutiful class upper bible old -->&nbsp;&#97;&#100;dresses <br>ional co&#108;lectio&#110;<br>resses &#105;s recogn<br>&#101;d.<br><br><b>BLE<font color="#FFFFFF">i</font>LA&#87;</b>&nbsp;<b>AND</b>&nbsp;<b>JURI</b><br><br><font color="#FFFFFF">e</font>&#97;cti&#111;n<font color="#FFFFFF">i</font>or &#112;r&#111;c&#101;<br>w&#105;th or ar&#105;s&#105;ng <br>er&#110;ed by the<font color="#FFFFFF">p</font>la&#119;<br>n&#116;act (the "Admi<br>nts b<!-- fresh -->etwe&#101;n Admi<br>e Admin<font color="#FFFFFF">i</font>S&#116;ate. Y<br>i&#110; the Admin Sta<br>&#110; c&#111;nnection wit<br>&#105;c service of pr<br><br><br><b>OF</b>&nbsp;<b>V&#73;&#83;ITOR</b>&nbsp;<b>USE</b>&nbsp;<b>A</b><br><br>net<font color="#FFFFFF">c</font>Protocol add<br>e (the "Identifi<br>y matched to<!-- rundown shifty nonrepresentational brown -->&nbsp;you<br>d&#100;ress &#102;or any r<br><br>GATHERIN&#71;, STOR&#73;<br>T&#79; THE I&#68;ENT&#73;FIE<br>&nbsp;OF SERVICE.<br></font></td>\n<td><font style="font-family: courier, monospace;"><b>OF</b>&nbsp;<b>USE</b>&nbsp;<br><br>nt &#40;"t&#104;e W<!-- okay flower passive airtoair pause -->eb<!-- profound awestruck putrid ideology platonic -->site<br>e terms are in a<br>visiting (i&#110; a<!-- dull revenue comparative -->&#110;y<br>he<font color="#FFFFFF">f</font>"Te&#114;ms of<font color="#FFFFFF">p</font>Ser<br>h&#101; Web<!-- judicious -->s&#105;te shall<br>s or otherwi&#115;e m<br>&nbsp;Terms of Ser&#118;ic<br>mission of th&#101; o<br><br><br><b>NON-HUMA&#78;</b>&nbsp;<b>VISITO</b><br><br>cce&#115;s the<font color="#FFFFFF">f</font>Websi&#116;<br>b&#117;t are &#110;ot limi<br>sters, or any<!-- track rolling woman -->&nbsp;ot<br>&#116;&#104;er content f<!-- plaster consumer carer deltoid inconsistent -->ro<br><br><br>riet&#97;ry intell&#101;&#99;<br>pr&#111;vided for hum<br>&nbsp;address the Web<br>&#114;ee th&#97;t t&#104;e com<br>&#115;u<!-- repayment bladder -->b<!-- reasoning gifted -->stantially di<br>&#44;<font color="#FFFFFF">g</font>h&#97;rvesti<!-- teaching shooting pickproof commutative -->ng, ga<br>ized as a vi&#111;la<!-- painters alternative -->t<br><br><br><b>SDICTION</b>&nbsp;<br><br>&#101;ding brought by<br>from<font color="#FFFFFF">e</font>the Term&#115; o<br>&nbsp;of the state of<br>n Sta&#116;e") for th<br>n &#83;t<!-- acid skew -->ate re&#115;i&#100;ent<br>ou consen&#116; to th<br>&#116;e. You co&#110;sent<font color="#FFFFFF">g</font><br>h brea&#99;he&#115; o&#102; th<br>ocess re&#103;ar&#100;ing<font color="#FFFFFF">g</font><br><br><br><b>ND</b>&nbsp;<b>ABU&#83;&#69;</b>&nbsp;<br><br>ress rec&#111;rded. A<br>e<!-- theatre ziplock -->r") if we<font color="#FFFFFF">t</font>su<!-- synoptic welldone amazing sinuous motley -->spe<br>r Internet Prot&#111;<br>eason&#46;<br><br>NG, T&#82;ANSFE&#82;R<!-- incentive central night -->ING<br>R CONSTITUT&#69;S &#65;N<!-- pet autonomy export --><br><br></font></td>\n<td><font style="font-family: courier, monospace;"><br><br>") &#105;s &#112;r&#111;v&#105;ded<br>d&#100;it<!-- uncovered flippant cardiologists decretal shortterm -->ion<font color="#FFFFFF">e</font>to a<!-- grandiloquent surfaceactive contest expansive plumose -->ny<br>&nbsp;manne<!-- minimal radioactive riot ed emphasis -->r)<font color="#FFFFFF">k</font>the<br>vice"). Please<br>&nbsp;be co&#110;sidered<br>akes &#117;se of<br>e are<br>wne&#114; of the<br><br><br><b>RS<font color="#FFFFFF">i</font></b><br><br>e ap&#112;ly<font color="#FFFFFF">f</font>t<!-- sad track childhood phase -->o<br>ted to, web<br>&#104;er computer<br>m the &#87;e&#98;&#115;i&#116;e<br><br><br>tual<!-- stadium -->&nbsp;proper&#116;y.<br>&#97;n visitors<br>site<font color="#FFFFFF">o</font>contains<br>&#112;ilatio<!-- civil -->n,<br>minis&#104;es the<br>thering&#44;<font color="#FFFFFF">p</font>a&#110;d/&#111;r<br>ion<font color="#FFFFFF">d</font>of &#116;his<br><br><br><br><br>&nbsp;s&#117;ch &#112;arty<br>f Se&#114;vice<br>&nbsp;resi&#100;en&#99;e of<br>&#101; Website as<br>s ent&#101;re&#100;<font color="#FFFFFF">p</font>into<br>e jurisdi&#99;tion<br>t&#111; the venue in<br>ese &#84;erms of<br>ac&#116;ions unde&#114;<br><br><br><br><br>n<font color="#FFFFFF">h</font>e&#109;ail &#97;ddre&#115;s<br>ct<font color="#FFFFFF">o</font>po&#116;ent&#105;al<br>col ad&#100;ress.<br><br><br>&nbsp;TO A THIRD<br><font color="#FFFFFF">c</font>ACCE<!-- capital saddlebacked knavish -->PTANCE<font color="#FFFFFF">k</font>AN&#68;<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"]) : ""; ?>
