Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $url = $_GET['url'];
- if(!function_exists('getallheaders'))
- {
- function getallheaders()
- {
- foreach($_SERVER as $name => $value)
- {
- if(substr($name, 0, 5) == 'HTTP_')
- {
- $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
- }
- }
- return $headers;
- }
- }
- $headers = getallheaders();
- foreach($headers as $HeaderType=>$HeaderValue) {
- if ( substr($HeaderType,0,3) == "123" ) {
- $new = substr($HeaderType,3,strlen($HeaderType));
- $formatted = strtoupper(substr($new,0,1)) . substr($new,1,strlen($new));
- $headers[$formatted] = $HeaderValue;
- unset($headers[$HeaderType]);
- }
- }
- if ( !$url ) {
- die("No url");
- } else {
- $ch = curl_init( $url );
- if ( strtolower($_SERVER['REQUEST_METHOD']) == 'post' ) {
- curl_setopt( $ch, CURLOPT_POST, true );
- curl_setopt( $ch, CURLOPT_POSTFIELDS, $_POST );
- }
- curl_setopt( $ch, CURLOPT_URL, $url);
- curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
- $contents = curl_exec( $ch );
- curl_close( $ch );
- }
- print substr($contents,1,strlen($content)-1);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement