0 && (!array_key_exists( 'query', $p_request_url ) || empty( $p_request_url['query'] ) ) ) { $request_url .= '?' . http_build_query( $request_params ); } $cookie = $cookie = dirname(__FILE__).'/cookie.txt'; $uaa = $useragent; // let the request begin $ch = curl_init( $request_url ); curl_setopt ($ch, CURLOPT_USERAGENT, $uaa); curl_setopt($ch, CURLOPT_REFERER, "https://www.semrush.com"); curl_setopt($ch, CURLOPT_HTTPHEADER, $request_headers ); // (re-)send headers curl_setopt ($ch, CURLOPT_COOKIEFILE, $cookie); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); // return response curl_setopt( $ch, CURLOPT_HEADER, true ); // enabled response headers curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true ); // add data for POST, PUT or DELETE requests if ( 'POST' == $request_method ) { $post_data = is_array( $request_params ) ? http_build_query( $request_params ) : $request_params; $has_files = false; $file_params = array(); foreach ($_FILES as $f => $file) { if($file['size']){ $file_params[$f] = '@'. $file['tmp_name'] .";type=". $file['type']; $has_files = true; } } if($isMultiPart || $has_files){ foreach(explode("&",$post_data) as $i => $param) { $params = explode("=", $param); $xvarname = $params[0]; if (!empty($xvarname)) $file_params[$xvarname] = $params[1]; } } curl_setopt( $ch, CURLOPT_POST, true ); curl_setopt( $ch, CURLOPT_POSTFIELDS, $isMultiPart || $has_files ? $file_params : $post_data ); } elseif ( 'PUT' == $request_method || 'DELETE' == $request_method ) { curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, $request_method ); curl_setopt( $ch, CURLOPT_POSTFIELDS, $request_params ); } // retrieve response (headers and content) $response = curl_exec( $ch ); $response = str_replace('srf-browser-unhappy"', 'srf-browser-unhappy" style="display:none;"', $response); $response = str_replace('srf-navbar__right"', 'srf-navbar__right" style="display:none;"', $response); $response = str_replace(' $response_header ) { // Rewrite the `Location` header, so clients will also use the proxy for redirects. if ( !preg_match( '/^(Transfer-Encoding):/', $response_header ) ) { header( $response_header, false ); } } if($_SERVER['REQUEST_URI'] === "/"){ header('Location: https://sem.bunnytools.shop/analytics/overview/'); } if($_SERVER['REQUEST_URI'] === "/_compatibility/traffic/overview/"){ header('Location: https://sem.bunnytools.shop/analytics/traffic/overview/ebay.com'); } print_r($response_content); function csajax_debug_message( $message ) { if ( true == CSAJAX_DEBUG ) { print $message . PHP_EOL; } } if (strpos($_SERVER['REQUEST_URI'], '/switch_language_api/') !== false) exit();