<?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: Wed, 30 May 2012 11:37:19 -0700
//  For Domain: rud.is
//  
//  

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

define('__HPOT_TAG1',    '4cc17d281aaa54dc23f7e39a7dcfbcfe');
define('__HPOT_TAG2',    'f0c5d9e520456819a0134d98d039a6f2');
define('__HPOT_TAG3',    '34aa2473d1aa4705f92165addfe297ff');

define('__CLASS_STYLE_1','trili');
define('__CLASS_STYLE_2','buha');

define('__DIV1',         'dr4w9v5tr74');

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>Rud.is|automation</title>\n</head>\n');
define('__ROBOT1',       '<meta name="robots" content="follow">\n<meta name="robots" content="noindex">\n<meta name="robots" content="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"><tr>\n<td><div style="font-family: courier, monospace;">&nbsp;&nbsp; <b><font color=white>d</font></b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>&nbsp;<br>The website from<br>to you<font color=white>e</font>subject<font color=white>e</font>t<br>ot&#104;&#101;r &#116;erm&#115; gove<br>Website you acce<br>read them carefu<br>agent&#115;<font color=white>e</font>&#111;f t&#104;&#101; in<br>them.<font color=white>f</font>Th&#101;<font color=white>k</font>access<br>non-tra&#110;sferable<br>Website.<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <b>S</b><br><font color=white>p</font><br>Special &#114;&#101;stric&#116;<br>No&#110;-Huma&#110; &#86;isito<br>&#115;piders, bots, i<br>prog&#114;ams designe<br>automat&#105;cally&#46;<br><br>E&#109;ail addresses <br>It i&#115;<font color=white>p</font>recognized<br>alone. You ackno<br>has<font color=white>g</font>a va&#108;u&#101; not <br>storage,<font color=white>d</font>and/or <br>value of the&#115;e a<br>storing this Web<br>a&#103;r&#101;e&#109;ent and &#101;x<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <b><font color=white>g</font></b>&nbsp; &nbsp; <b><font color=white>k</font></b><br>&nbsp;<br>Each part&#121; agree<br>aga&#105;nst the othe<br>("Judicial Ac&#116;&#105;o<br>the r&#101;gistered A<br>such l&#97;ws &#97;re<font color=white>a</font>ap<br>and<font color=white>s</font>performed en<br>of federa&#108; and s<br>any ac&#116;ion broug<br>Ser&#118;&#105;ce. Y&#111;u<font color=white>a</font>con<br>&#116;he<font color=white>k</font>&#97;b&#111;v&#101; ag&#114;eem<br><br>&nbsp;<b><font color=white>f</font></b>&nbsp; &nbsp; &nbsp;&nbsp; <b><font color=white>s</font></b>&nbsp; &nbsp; <b><font color=white>p</font></b>&nbsp;<br>&nbsp;<br>You<font color=white>c</font>&#99;&#111;&#110;sent to h<br>may ap&#112;ear<font color=white>k</font>somew<br>abuse. T&#104;e Ident<br>V&#105;sit&#111;rs agree n<br><br>VISITOR&#83; AGREE T<br>PARTY OR SENDING<br>SUBSEQUE&#78;T BRE&#65;C<br></div></td>\n<td><div style="font-family: courier, monospace;"><b><font color=white>p</font><font color=white>c</font><font color=white>h</font></b>&nbsp; &nbsp;&nbsp; <b><font color=white>g</font><font color=white>k</font></b>&nbsp;<b>TERMS</b><br><br>&nbsp;whi&#99;h you acces<br>o &#116;he follow&#105;ng<font color=white>t</font><br>rning &#97;cce&#115;s<font color=white>a</font>&#116;o <br>pt t&#104;e&#115;e terms a<br>lly. Any &#78;on-Hum<br>dividu&#97;l(&#115;) who <br>&nbsp;rights grante&#100; <br><font color=white>c</font>without the exp<br><br><br><b>PECIAL<font color=white>s</font>L&#73;CEN&#83;E</b>&nbsp;<b>R</b><br><br>ions on a v&#105;si&#116;o<br>rs&#46; Non&#45;Human Vi<br>nd&#101;xers, ro&#98;&#111;ts,<br>d to access, &#114;ea<br><br><br>o&#110; &#116;his site are<br>&nbsp;tha&#116; &#116;h&#101;se emai<br>wl&#101;dge and<font color=white>a</font>a&#103;re&#101;<br>less &#116;h&#97;n US $50<br>distrib&#117;tion of<font color=white>d</font><br>d&#100;resses. &#73;ntent<br>&#115;ite\'&#115; email add<br>pre&#115;sl&#121; p&#114;o&#104;ibit<br><br><b><font color=white>i</font></b>&nbsp; &nbsp; &nbsp;&nbsp; <b><font color=white>o</font>A&#80;PLICA</b><br><br>s that any suit,<br>r in &#99;onnectio&#110;<font color=white>s</font><br>n") &#115;ha&#108;l b&#101; gov<br>dministrat&#105;v&#101; C&#111;<br>pli&#101;d to agreeme<br>t&#105;rely within<font color=white>k</font>th<br>tat&#101; courts &#119;ith<br>ht &#97;g&#97;inst hi&#109; i<br>sent &#116;o electron<br>ent.<br><br>&nbsp; &nbsp; <b><font color=white>f</font></b>&nbsp;<b><font color=white>o</font></b>&nbsp;<b>RECORDS</b>&nbsp;<br><br>aving your Inter<br>&#104;ere on this pag<br>ifier is unique&#108;<br>o&#116; to<font color=white>f</font>&#117;se this a<br><br>HAT HA&#82;VES&#84;I&#78;G, <br><font color=white>c</font>ANY MESS&#65;GE(S) <br>H &#79;F TH&#69;S&#69; TERMS<br></div></td>\n<td><div style="font-family: courier, monospace;">&nbsp;<b>AND</b>&nbsp;<b>CONDITION&#83;</b>&nbsp;<br><br>sed &#116;his agr&#101;e&#109;&#101;<br>condi&#116;ion&#115;. &#84;hes<br>th&#101; Website. By <br>nd c&#111;&#110;dition&#115; (t<br>&#97;n Vis&#105;tors to t<br>con&#116;r&#111;ls,<font color=white>e</font>author<br>to yo&#117; un&#100;er the<br>&#114;&#101;ss writ&#116;en<font color=white>d</font>p&#101;r<br><br><br><b>E&#83;TR&#73;CTIONS</b>&nbsp;<b>FOR</b>&nbsp;<br><br>r\'s<font color=white>k</font>l&#105;c&#101;n&#115;e to a<br>sitors incl&#117;d&#101;, <br><font color=white>d</font>cra&#119;lers, harv&#101;<br>d, com&#112;ile &#111;r ga<br><br><br>&nbsp;considered prop<br>l<font color=white>e</font>addresses are <br>&nbsp;th&#97;t each email<br>&#46; You furt&#104;er ag<br>th&#101;se addresse&#115; <br>ional collection<br>resses is recogn<br>ed.<br><br><b>B&#76;E</b>&nbsp;<b>LAW</b>&nbsp;<b>AND</b>&nbsp;<b>JURI</b><br><br><font color=white>i</font>act&#105;on or proce<br>with or arising <br>&#101;&#114;ned<font color=white>d</font>by the l&#97;w<br>&#110;tac&#116; (the "Admi<br>nts bet&#119;een<font color=white>e</font>Admi<br>e &#65;dmin St&#97;&#116;e. Y<br>in the<font color=white>g</font>Admin Sta<br>&#110; connection wit<br>&#105;c se&#114;vice of<font color=white>e</font>pr<br><br><br><b>OF</b>&nbsp;<b>VISITOR</b>&nbsp;<b>US&#69;<font color=white>p</font>A</b><br><br>net Pro&#116;ocol add<br>e<font color=white>e</font>(the<font color=white>o</font>"I&#100;entifi<br>y match&#101;d &#116;o you<br>ddress fo&#114; a&#110;y r<br><br>GATHER&#73;NG, STORI<br>TO THE<font color=white>f</font>IDENT&#73;FIE<br>&nbsp;OF SERVICE.<br></div></td>\n<td><div style="font-family: courier, monospace;"><b>OF</b>&nbsp;<b>USE</b>&nbsp;<br><br>&#110;t ("the<font color=white>a</font>We&#98;site<br>e terms are i&#110; a<br>v&#105;siting (in any<br>he "Terms of Se&#114;<br>he W&#101;bsite shall<br>&#115; or &#111;t&#104;er&#119;ise m<br><font color=white>e</font>&#84;&#101;r&#109;s<font color=white>d</font>of Ser&#118;ic<br>miss&#105;&#111;n of<font color=white>f</font>th&#101; o<br><br><br><b>NON-HU&#77;AN</b>&nbsp;<b>VISITO</b><br><br>cces&#115; th&#101; We&#98;sit<br>b&#117;t a&#114;e not limi<br>sters,<font color=white>e</font>o&#114; any ot<br>the&#114; cont&#101;nt fro<br><br><br>riet&#97;ry in&#116;ellec<br>&#112;&#114;o&#118;ided for h&#117;m<br>&nbsp;address the Web<br>r&#101;e that th&#101; &#99;&#111;m<br>su&#98;stantially di<br>, &#104;arve&#115;t&#105;&#110;g, g&#97;<br>ized as a violat<br><br><br><b>SDICTION</b>&nbsp;<br><br>&#101;&#100;ing brought<font color=white>p</font>by<br>from th&#101;<font color=white>e</font>Terms o<br>&nbsp;&#111;f the st&#97;te of<br>n State") for<font color=white>g</font>th<br>&#110; State res&#105;den&#116;<br>&#111;u<font color=white>s</font>consen&#116; &#116;o &#116;h<br>te. You con&#115;ent <br>&#104; breaches &#111;f th<br>&#111;c&#101;ss reg&#97;rdin&#103; <br><br><br><b>ND<font color=white>d</font>ABUSE</b>&nbsp;<br><br>r&#101;ss recor&#100;ed. A<br>er") if w&#101; sus&#112;e<br>r &#73;n&#116;ernet Prot&#111;<br>&#101;a&#115;on.<br><br>N&#71;&#44; TRANSFERRING<br>R<font color=white>k</font>&#67;ONS&#84;ITUTES AN<br><br></div></td>\n<td><div style="font-family: courier, monospace;"><br><br>") is pro&#118;ided<br>&#100;dit&#105;on to any<br>&nbsp;manner) &#116;he<br>vice"). Please<br>&nbsp;be considered<br>a&#107;es<font color=white>k</font>use<font color=white>i</font>of<br>e are<br>wne&#114; o&#102; the<br><br><br><b>RS</b>&nbsp;<br><br>&#101; apply to<br>ted to&#44; &#119;eb<br>her computer<br>m &#116;he<font color=white>d</font>Website<br><br><br>tual pro&#112;er&#116;y.<br>an &#118;is&#105;tors<br>s&#105;&#116;e &#99;ontains<br>pila&#116;&#105;on&#44;<br>min&#105;shes th&#101;<br>th&#101;ring&#44; and/or<br>i&#111;n of<font color=white>g</font>&#116;his<br><br><br><br><br>&nbsp;&#115;uch<font color=white>f</font>pa&#114;ty<br>f S&#101;rvic&#101;<br><font color=white>s</font>r&#101;sidence of<br>e Web&#115;&#105;te a&#115;<br>&#115; entered into<br>&#101; jur&#105;sdiction<br>to the<font color=white>o</font>venue in<br>ese Term&#115; of<br>&#97;&#99;tions un&#100;er<br><br><br><br><br>n ema&#105;l addr&#101;ss<br>ct potential<br>&#99;ol address&#46;<br><br><br>&nbsp;TO A THI&#82;D<br>&nbsp;AC&#67;EPTANCE AN&#68;<br><br></div></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"]) : ""; ?>
