/[drupal]/contributions/sandbox/borismann/purple/purple-proxy.php
ViewVC logotype

Contents of /contributions/sandbox/borismann/purple/purple-proxy.php

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Thu Jul 19 06:56:00 2007 UTC (2 years, 4 months ago) by borismann
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/x-php
Now adding files in purple module folder
1 <?
2
3 // this file under the public domain
4
5 // turn off all error reporting
6 error_reporting(0);
7
8 $url = $_GET['url'];
9
10 // only http and https supported
11 if(preg_match("/^https?\:.*/", $url)){
12 $html = file_get_contents($url);
13
14 // TODO: make sure we have XML and not some other
15 // content type or an error message
16
17 // get the status code of the response
18 list($version, $status_code, $msg) = explode(' ', $http_response_header[0], 3);
19 switch($status_code){
20 case 200: case 304:
21 header('Content-type: text/html');
22 echo($html);
23 break;
24 default:
25 header($http_response_header[0]);
26 break;
27 }
28 }else{
29 header('HTTP/1.1 403 Forbidden');
30 header('Content-type: text/html');
31 echo("You are not allowed to retrieve this resource");
32 }
33 ?>
34

  ViewVC Help
Powered by ViewVC 1.1.2