Hallo
Ich habe folgendes Problem ich will einen RSS FEED via PHP auf meine Homepage einabauen. Das Problem ist hinter meinem System hängt ein Proxy server. Der es verhindert das ich die RSS/XML Datei mit Fopen öffnen kann. Nach langer suche habe ich eine paar scripte gefunden die evtl. funktionieren könnten tun sie aber nicht.
Jetzt meine Frage an euch wie krieg ich den RSS FEED trotz Proxies zum laufen.
Als XML PRaser nutze ich ein Script von Stefan Fischer.
Mein PLan ist es mit diesem Script die Datei auszugeben und das ergebniss an den XML Praser zu übergeben.
Diese Scrpit gibt mir die Fehler Meldung aus Parse error: parse error, unexpected '{' in \RSS\proxy3.php on line 25
Danke für jede Hilfe
mfg
Markus Halm
Ich habe folgendes Problem ich will einen RSS FEED via PHP auf meine Homepage einabauen. Das Problem ist hinter meinem System hängt ein Proxy server. Der es verhindert das ich die RSS/XML Datei mit Fopen öffnen kann. Nach langer suche habe ich eine paar scripte gefunden die evtl. funktionieren könnten tun sie aber nicht.
Jetzt meine Frage an euch wie krieg ich den RSS FEED trotz Proxies zum laufen.
Als XML PRaser nutze ich ein Script von Stefan Fischer.
Mein PLan ist es mit diesem Script die Datei auszugeben und das ergebniss an den XML Praser zu übergeben.
Code:
<?php
/* http_connect_example.php
* This is an example of how you can connect to
* a remote HTTP server via a proxy server using php
* By Guy Boyd 2004*/
/* Fill out your proxy username and password
* and the address and port number of the proxy server */
$proxy_address="192.168.21.1";
$proxy_port="8080";
/* Enter the address of the remote server you wish to connect to. */
$path = "/newsticker.rdf";
$domain = "http://www.tagesschau.de";
/* We have all the ingredients, lets bake this cookie. */
$message = "GET $domain$path HTTP/1.1\r\n";
$message .= "Host: $domain\r\n";
$message .= "Connection: Close\r\n";
$message .= "\r\n";
/* Attempt to connect to the proxy server to retrieve the remote page */
if(!$socket = fsockopen($proxy_address, $proxy_port, $errno, $errstring, 20){
die("Could not connect to host $proxy_address : $errno : $errstring\n");
}
/* Write out the http commands to the socket. */
fwrite($socket, $message);
/* We then get the contents it returns, this includes the http headers
* as well as any <html> code. If need be you can strip the headers by
* removing everything before the first instance of "\r\n\r\n" */
$contents = "";
while (!feof($socket)){
$contents .= fgets($socket, 128);
}
/* Clean up */
fclose($socket);
/* Contents contains both the html headers and the html of the page.
* We can do whatever we want with it below here, we echo out as an example. */
echo $contents;
?>
Diese Scrpit gibt mir die Fehler Meldung aus Parse error: parse error, unexpected '{' in \RSS\proxy3.php on line 25
Danke für jede Hilfe
mfg
Markus Halm