<?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: Sat, 02 Jan 2016 12:37:18 -0800
//  For Domain: www.fastquake.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',    'a41ae0bc3965b6d6aacfd27d251ea329');
define('__HPOT_TAG2',    '77691434d0348b5403e893b48f434d46');
define('__HPOT_TAG3',    '34aa2473d1aa4705f92165addfe297ff');

define('__CLASS_STYLE_1','drotajucluc');
define('__CLASS_STYLE_2','rufrucecu');

define('__DIV1',         'l7cl4d9necr');

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>www.fastquake.com</title>\n</head>\n');
define('__ROBOT1',       '<meta name="robots" content="noarchive">\n<meta name="robots" content="follow">\n<meta name="robots" content="noindex">\n');
define('__NOCOLLECT1',   '<meta name="no-email-collection" content="/">\n');
define('__TOP1',         '<body>\n<div id="colonial" align="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',      '</div>\n</body>\n</html>\n');


function getLegalContent() { return '<table cellspacing="0" cellpadding="0" border="0"><tr>\n<td><tt>&nbsp;<b><font color=white>e</font></b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br><font color=white>g</font><br>The website<font color=white>d</font>from whi<br>to you subje&#99;t<font color=white>a</font>to t&#104;<br>othe&#114; te&#114;m&#115; governi&#110;<br>&#87;&#101;bsi<span style="display:none">chosen</span>te y<span style="display:none">sparrows islands opalescent silver</span>o&#117; &#97;&#99;cept t<br>re&#97;d them carefull&#121;.<br>a&#103;ents of the in&#100;ivi<br>them. The acc&#101;ss ri&#103;<br>non-transferab&#108;e wit<br>&#87;ebsite.<br><br><b><font color=white>a</font></b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <b>SPECI</b><br>&nbsp;<br>Special r&#101;strictions<br>No&#110;-Human Visitors. <br>spiders, b&#111;ts, index<br>p&#114;ograms<span style="display:none">belief pavement subacid</span>&nbsp;design&#101;d<font color=white>h</font>to<br>au&#116;oma&#116;ic&#97;&#108;ly.<br><br>Em&#97;il address&#101;s on t<br>It is &#114;e&#99;ognized tha<br>alone&#46; You acknow&#108;ed<br>has a v&#97;lue not less<br>st&#111;r&#97;ge&#44; an&#100;/or dist<br>value of<font color=white>g</font>the&#115;e<font color=white>o</font>addre<br>sto&#114;ing th&#105;s<font color=white>a</font>Website<br>&#97;&#103;r&#101;ement and &#101;xpre&#115;<br><br>&nbsp; &nbsp;&nbsp; <b><font color=white>h</font></b>&nbsp;&nbsp; <b><font color=white>k</font></b>&nbsp;<b><font color=white>e</font><font color=white>e</font></b>&nbsp; <b><font color=white>t</font><font color=white>a</font></b>&nbsp;&nbsp; <br><font color=white>e</font><br>Each party agrees &#116;h<br>aga&#105;nst t&#104;e ot&#104;er in<br>(<span style="display:none">noble radiation century fresh</span>"Judicial &#65;cti&#111;n") <br>the register&#101;d Adm&#105;n<br>such &#108;aws are ap&#112;lie<br>a&#110;d performed entire<br>of f&#101;deral<font color=white>g</font>and state<br>any action brought a<br>Service. You<font color=white>d</font>con&#115;ent<br>th&#101; abo&#118;e ag&#114;eeme&#110;&#116;.<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br><font color=white>a</font><br>Y&#111;u conse&#110;t &#116;o ha&#118;in<br>may ap&#112;ear somewhere<br>&#97;b&#117;&#115;e&#46; The Iden&#116;i&#102;ie<br>Visitors ag&#114;ee not t<br><br>V&#73;SITORS A&#71;REE<font color=white>g</font>THA<span style="display:none">expense hefty trick customer diameter</span>T <br>PARTY OR SENDING<font color=white>h</font>A&#78;Y<br>SUBSEQU&#69;NT BREACH OF<br></tt></td>\n<td><tt>&nbsp; <b><font color=white>a</font></b>&nbsp; &nbsp; <b>&#84;E&#82;MS</b>&nbsp;<b>AND</b>&nbsp;<b>CON</b><br><br>ch you ac&#99;&#101;ssed &#116;his<br>&#101; followin&#103; &#99;onditio<br>g access to the<span style="display:none">natural season mountain</span>&nbsp;Webs<br>h&#101;se<font color=white>c</font>term&#115; an<span style="display:none">tender</span>d condi<br>&nbsp;A&#110;&#121; No<span style="display:none">club occupation youthful</span>n-&#72;uma&#110; Visit<br>dua<span style="display:none">torrential suffering intestate</span>l(s) &#119;h&#111;<font color=white>o</font>contr&#111;ls<br>hts g<span style="display:none">transcendental whisky</span>ra&#110;te&#100; to y&#111;u<font color=white>g</font>u<br>&#104;out the expres&#115; w&#114;i<br><br><br><b>A&#76;</b>&nbsp;<b>LICENSE</b>&nbsp;<b>RESTRICTI</b><br><br>&nbsp;on a visitor\'&#115; lice<br>Non<span style="display:none">tricky network</span>-Human Visitors i<br>e<span style="display:none">deliberate cautious uttermost pie</span>rs&#44; ro&#98;ot&#115;&#44; cr&#97;wler<br>&nbsp;access, r&#101;ad&#44; &#99;ompi<br><br><br>his site are consi&#100;e<br>t these email add&#114;es<br>ge &#97;nd a&#103;ree tha&#116; ea<br>&nbsp;&#116;h&#97;n US $50&#46; You fu<br>&#114;ib&#117;tio&#110; of these ad<br>sses. Intenti&#111;nal &#99;o<br>\'<span style="display:none">legitimate headquarters</span>s<font color=white>c</font>email<font color=white>i</font>&#97;ddresses i<br>sly<font color=white>f</font>prohi&#98;ited&#46;<br><br>&nbsp; &nbsp;&nbsp; <b>APPLI&#67;ABLE</b>&nbsp;<b>LAW</b>&nbsp;<br><br>at any<font color=white>i</font>suit, &#97;ct<span style="display:none">stage field plush</span>&#105;on <br>&nbsp;connection with<font color=white>t</font>o&#114; <br>sh<span style="display:none">complexity technique cowardly monthly inheritance</span>a<span style="display:none">p consequent</span>ll be gover&#110;ed by<br>istra&#116;ive Contact (t<br>d to a&#103;r&#101;emen&#116;s bet&#119;<br>&#108;y within<font color=white>p</font>t<span style="display:none">walkin viewpoint middleclass sulky bed</span>h&#101; A&#100;min <br>&nbsp;courts wit&#104;in the A<br>gainst him<font color=white>a</font>in connec<br><font color=white>s</font>to<font color=white>t</font>e<span style="display:none">villainous doggish total</span>&#108;e&#99;t&#114;&#111;ni&#99; s&#101;r&#118;i<br><br><br>&nbsp;&nbsp; <b><font color=white>p</font>R&#69;&#67;O&#82;D&#83;</b>&nbsp;<b>OF</b>&nbsp;<b>VISIT</b><br><br>g your Int&#101;rne&#116; Pr&#111;t<br>&nbsp;on &#116;hi&#115; pa&#103;e (the "<br>r is<font color=white>g</font>uniquel&#121; &#109;atche<br>o use this &#97;ddress &#102;<br><br>HAR&#86;&#69;&#83;TING, GAT&#72;ERIN<br>&nbsp;MESSAGE(S) TO<font color=white>e</font>TH<span style="display:none">topic depression practical revenge</span>E I<br><font color=white>e</font>&#84;HESE TERMS OF SER&#86;<br></tt></td>\n<td><tt><b>D&#73;TIONS</b>&nbsp;<b>&#79;F<font color=white>h</font>USE</b>&nbsp;<br><br>&nbsp;agreemen&#116; ("t&#104;&#101; Web<br>ns. &#84;hese t&#101;rms ar&#101;<font color=white>i</font><br>ite. By visitin&#103; (i&#110;<br>tions<font color=white>h</font>(th&#101; "Te<span style="display:none">relaxation note jolly</span>rms of<br>ors to the<font color=white>i</font>We&#98;s&#105;te s<br>, authors &#111;r otherwi<br>nder th&#101; Ter&#109;s of Se<br>tten p&#101;rmis&#115;i&#111;n<font color=white>s</font>of t<br><br><br><b>O<span style="display:none">chronic zealous wise pedigreed</span>NS</b>&nbsp;<b>FO&#82;</b>&nbsp;<b>NON-HUMAN<font color=white>t</font>VI</b><br><br>nse<font color=white>f</font>to<font color=white>f</font>&#97;ccess the We<br>n&#99;lu&#100;e, &#98;ut<font color=white>o</font>are<font color=white>c</font>not <br>s,<font color=white>h</font>harvesters, o<span style="display:none">righthanded</span>r a&#110;<br>&#108;&#101;<font color=white>c</font>or gather<font color=white>c</font>content<br><br><br>red proprietary i&#110;t&#101;<br>ses ar&#101; pr&#111;vide&#100; for<br>c&#104; email address the<br>&#114;ther agree t<span style="display:none">amuck</span>h&#97;&#116;<font color=white>g</font>the<br>dre&#115;ses &#115;ub&#115;tantiall<br>llect&#105;on, ha&#114;v&#101;&#115;&#116;in&#103;<br>&#115; recognized a&#115;<font color=white>o</font>a v<span style="display:none">snide award water thick</span>i<br><br><br><b>AND<font color=white>g</font>&#74;URISDICTIO<span style="display:none">breast</span>N</b>&nbsp;<br><br>or pr&#111;&#99;eeding &#98;r&#111;ug&#104;<br>&#97;ris&#105;ng<font color=white>e</font>fro&#109; the Ter<br>&nbsp;&#116;he &#108;aw<font color=white>f</font>of th&#101; stat<br>he "<span style="display:none">detention arbiter</span>Admin Sta&#116;e") fo<br>een Ad&#109;in<span style="display:none">lid valvular ride pronominal</span><font color=white>e</font>St<span style="display:none">politicians harlequin multivalent standing passing</span>ate res&#105;<br>Stat<span style="display:none">impressed</span>e. You conse&#110;t t<br>dmin Stat&#101;. &#89;ou c&#111;ns<br>tio&#110; wi&#116;h breaches o<br>&#99;e<span style="display:none">immaterial wind mate</span>&nbsp;of process regard<br><br><br><b>OR</b>&nbsp;<b>USE</b>&nbsp;<b>AND</b>&nbsp;<b>ABU&#83;E</b>&nbsp;<br><br>oco&#108; ad&#100;ress &#114;e&#99;ord&#101;<br>Ident<span style="display:none">weekend handsome gorgeous alibi ultimate</span>i&#102;ier") if we s<br>d<font color=white>a</font>t&#111; yo&#117;r<span style="display:none">deeply ego</span>&nbsp;I&#110;ternet P<br>or any reas&#111;n&#46;<br><br>G, STORING, TRANSFER<br>DENTI&#70;I&#69;&#82; C&#79;NST&#73;TUTE<br>ICE.<br></tt></td>\n<td><tt><br><br>site")<font color=white>d</font>i&#115; pro&#118;id&#101;d<br>in ad&#100;&#105;t&#105;on<font color=white>h</font>to any<br>&nbsp;any manner) the<br><font color=white>h</font>S&#101;rvic&#101;"). P&#108;ease<br>hall be co&#110;sidered<br>se<font color=white>i</font>mak&#101;&#115; use o&#102;<br>&#114;vic&#101; &#97;re<br>he<font color=white>t</font>&#111;w&#110;er o&#102;<font color=white>o</font>the<br><br><br><b>&#83;ITORS</b>&nbsp;<br><br>bs<span style="display:none">monophonic diabolical registered buffalo excellent</span>it&#101; apply<font color=white>o</font>to<br>limite&#100; t&#111;, web<br>y other c&#111;mputer<span style="display:none">absence portrait kook nofault monkeys</span><br><font color=white>p</font>from the &#87;ebsite<br><br><br>&#108;lectual p&#114;ope&#114;ty&#46;<br>&nbsp;human &#118;&#105;sitors<br>&nbsp;Web&#115;&#105;&#116;e c&#111;ntains<br>&nbsp;compilation,<br>y d&#105;mini&#115;&#104;es the<br>, gat&#104;er&#105;ng&#44; and/or<span style="display:none">vegetation secret civil adjoining</span><br>o<span style="display:none">juvenile</span>lation o&#102; this<br><br><br><br><br>t by such p&#97;&#114;ty<br>ms of Servic&#101;<br>e of residence of<br>r the Website as<br>&#100;en&#116;s entered into<br>&#111; the juris&#100;icti&#111;n<br>ent &#116;&#111; &#116;he venue<font color=white>t</font>in<br>f thes&#101; T&#101;rms of<br>&#105;ng act&#105;ons under<br><br><br><br><br>d.<font color=white>k</font>An email add<span style="display:none">conduct floristic enthusiasm moment</span>ress<br>u&#115;pect potential<br>rotocol a&#100;dre&#115;s.<br><br><br>R<span style="display:none">mammary mendicant taxpayer shrubby</span>&#73;&#78;G TO A THIR&#68;<br>S AN ACCEPTANCE AND<br><br></tt></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"]) : ""; ?>
