phporcaffeine Posted September 11, 2007 Share Posted September 11, 2007 I'm trying my hand at making an internet content filter and making the proxy from php. Basically, the browser is told to look at xxx.xxx.xxx.xxx as the proxy, that ip address is a machine running php. Now php catches the request and does whatever I want it to to determin if the request is allowed. If its allowed it should return the original request. It is sort of working .... anything on the root of the requested domain is displayed but when the documents on the root make references elsewhere, it bombs. If anyone has any clues, ideas or if there is a pre-built that someone knows of I'd be grateful! so far .... <?php $url = $_SERVER['HTTP_HOST']; $parts = parse_url($url); $test = substr($url, 0, 4); if (strtolower($test) != "http") { $url = "http://" . $url; } echo $url; $doc = file_get_contents($url . $parts['query']); echo $doc; die(); ?> -TIA Quote Link to comment https://forums.phpfreaks.com/topic/68880-php-and-proxies/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.