" . $curl_command . ""; //$outputFile = 'fiddle.html'; //$curl = curl_init(); //curl_setopt($curl, CURLOPT_URL, $reformed_url); //curl_setopt($curl, CURLOPT_REFERER, $jsfiddle_url); //$fileHandle = fopen($outputFile, 'w'); //curl_setopt($curl, CURLOPT_FILE, $fileHandle); //curl_exec($curl); //fclose($fileHandle); if (curl_errno($curl)) { echo 'cURL error: ' . curl_error($curl); } else { echo 'Request completed successfully.'; echo 'link'; } curl_close($curl); } $error = ''; $result = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $command = $_POST['command']; preg_match("/'(.+?)'/", $command, $urlMatches); $url = $urlMatches[1]; preg_match("/'Referer: (.+?)'/", $command, $refererMatches); $referer = $refererMatches[1]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_REFERER, $referer); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $output = curl_exec($ch); if ($output !== false) { $filename = 'fiddle.html'; file_put_contents($filename, $output); $result = "File downloaded successfully as link"; } else { $error = "Error downloading file."; } curl_close($ch); } ?>


Source Code