Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $url = $_GET['url'];
- $headers = apache_request_headers();
- foreach($headers as $key => $value) {
- if ( $key == "Contenttype" ) {
- $headers['Content-Type'] = $value;
- $headers['Contenttype'] = nil;
- }
- if ( $key == "Auth" ) {
- $headers['Authorization'] = $value;
- $headers['Auth'] = nil;
- }
- }
- 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