Curl ist eh ziemlich selten installiert ... Folgendes sollte hingegen funktionieren: PHP-Code: <?phpfunction getRemoteFile($address) { $info = parse_url($address); if($fp = fsockopen($info['host'], (isset($info['port']) ? $info['port'] : 80), &$errno, &$error, 80)) { fwrite($fp, 'GET ' . $info['path'] . (isset($info['query']) ? '?' . $info['query'] : '') . ' HTTP/1.1' . "\r\n"); fwrite($fp, 'Host: ' . $info['host'] . "\r\n"); fwrite($fp, 'Connection: close' . "\r\n\r\n"); $getContent = false; $content = ''; while(!feof($fp)) { $line = fgets($fp, 1024); if(!$getContent && $line == "\r\n") { $getContent = true; } else { $content .= $line; } } return $content; } else { die ($errno . '# ' . $errro); }}echo getRemoteFile('http://www.google.de/');
<?phpfunction getRemoteFile($address) { $info = parse_url($address); if($fp = fsockopen($info['host'], (isset($info['port']) ? $info['port'] : 80), &$errno, &$error, 80)) { fwrite($fp, 'GET ' . $info['path'] . (isset($info['query']) ? '?' . $info['query'] : '') . ' HTTP/1.1' . "\r\n"); fwrite($fp, 'Host: ' . $info['host'] . "\r\n"); fwrite($fp, 'Connection: close' . "\r\n\r\n"); $getContent = false; $content = ''; while(!feof($fp)) { $line = fgets($fp, 1024); if(!$getContent && $line == "\r\n") { $getContent = true; } else { $content .= $line; } } return $content; } else { die ($errno . '# ' . $errro); }}echo getRemoteFile('http://www.google.de/');
Foren-Regeln