Code Diaries Proxy Core - Web Proxy
   Copyright (C) 2010  Ping Shin Ching

   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 3 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, see http://www.gnu.org/licenses.

	Ping Shin Ching
	righteous.ninja@gmail.com OR ping_sc@hotmail.com
	More information at http://codediaries.com
*/
include "guard.php";
include "coders.php";
include "constants.php";
include "host.php";
include "grokkers.php";
/*
 * Setup the gaurd cookie to prevent phishing accusations.
 */
setrawcookie($security_cookie, getguardcookie($_SERVER['REMOTE_ADDR']), 0, "/");
header(makeAllHTTPS("Location: {$myoriginalproxy}?" . $_SERVER['QUERY_STRING']));
        }
    }
    if (($loglevel & 8) == 8) {
        fwrite($outputf, "{$sub_req_url}\n----------\n{$headers}\n----------\n");
        fwrite($outputf, "{$original_output}\n\n\n***********************\n\n\n");
    }
    /* Add the header to html requests */
    if (preg_match("/\\b(html)\\b/ims", $contentType)) {
        $output = addHeadMaster($output, $sub_req_url, $rating);
    }
    /*****Time stuff*****/
    $xtime = round(microtime(true) - $xtime, 3);
    /* Add the base tag to 'collect' the half zombies*/
    $output = preg_replace("/<\\s*head\\s*>/ims", "<head><base href=\"" . encodeBaseTag($currentDirectory) . "\"/>", $output);
    /* If https convert all URLs to point to https */
    $output = makeAllHTTPS($output);
    /*
     * Send the output back to the client !!!!!!!!!!!!!!!!!!!!!
     */
    echo $output;
    /*
     * Flush all the output
     */
    ob_end_flush();
}
/*BIGELSE*/
/*
 * Close all the log file if you opened them.
 */
if (($loglevel & 1) == 1) {
    fclose($reqf);
You are about to surf to <b><?php 
            echo $_GET[URLNAMEPLAIN];
            ?>
</b> via the Code Diaries Proxy.
	<p>&nbsp;</p>
	
	<a href="<?php 
            echo "{$mysecurityhtml}/html_exit.php";
            ?>
"><font style="font-weight:bold;color:red">Get me out of here</font></a><br/>
	<font size="0.5em">I have no idea how I got here and I don't want to go here.</font>
	<p>&nbsp;</p>

	<a href="<?php 
            echo makeAllHTTPS("{$mysecurityhtml}/html_continue.php?" . $_SERVER['QUERY_STRING']);
            ?>
">
	<font style="color:green;font-weight:bold">Continue</font></a> <br/>
			
	<font size="0.5em">I agree to the <a href="javascript:void(0)" onclick="window.open('terms_and_conditions.html','Terms_and_Conditions','scrollbars=yes,menubar=no,width=600,height=400,toolbar=no')">terms and conditions</a> of this proxy.</font>
			
	<p>&nbsp;</p>

			
<?php 
        } else {
            ?>

Looks like there is an error.
<p>&nbsp;</p>
Exemple #4
0
	<table><tr><td><h2>Oops! It looks like we hit an error</h2></td></tr></table>
	<b>Either this proxy has encountered an internal error or there is a problem with the site you are trying to access.</b><br/><br/>
	Please bear in mind that this is a web-page based proxy and therefore has some limitations.
	If you could leave a comment via the link below, it will be greatly appreciated.

<?php 
}
?>
</td></tr>
<tr><td>
	<table><tr><td>
	<input type="button" onClick="history.go(-1)" class="prxfinbut" value="go back"/>
	<!-- 
	<form onsubmit="xsubmitx()" class="PRXform" target="_top" 
	action="<?php 
echo makeAllHTTPS($myoriginalproxy);
?>
">
	<table class="PRXformHeader"><tr><td><b>Enter url</b> </td><td> <input type="text" id="url" class="prxfinbox" size="60"/> 
	<input type="hidden" name="urlX" id="urlX" /> 
	</td><td><input type="submit" class="prxfinbut" value="submit"/></td></tr></table>
	</form>
	 -->
	</td></tr></table>
</td></tr>
<tr><td>
<a target="_top" href='http://code.google.com/p/codediariesproxy/issues/list'>Please leave a description of the Issue here</a>
 </td></tr>
</table>
</center>
</body>