error in reading the rss file
Posted: Wed Oct 18, 2006 5:54 am
feyd | Please use
then it is giving the following error:
--------------------------------------------------------------
Warning: fsockopen(): unable to connect to http://www.rediff.com:80 in c:\ecko\web\test\welcome.php on line 17
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (10060)
a)what is the solution to access that file
b) actually I have written code according the given example at RSSMix php parser
thanks in advance
ravi
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi,
when I am reading the rss file from rediff at " http://www.rediff.com/rss/inrss.xml " in php code that is given belowCode: Select all
<?php
$url="http://www.rediff.com/rss/inrss.xml";
preg_match("/^http:\/\/([^\/]+)(.*)$/", $url, $matches);
$host = $matches[1];
$uri = $matches[2];
$request = "GET $uri HTTP/1.0\r\n";
$request .= "Host: $host\r\n";
$request .= "User-Agent: localhost/0.1 http://localhost:80/\r\n";
$request .= "Connection: close\r\n\r\n";
print("$matches[0]\n................");
print("$matches[1]\n................");
print("$matches[2]\n");
$http = fsockopen($host, 80, $errno, $errstr, 1);
if (!$http) {
echo "$errstr ($errno)<br />\n";
} else {
fwrite($http, $request);
$response .= fgets($http, 4096);
// print("$response");
}
?>--------------------------------------------------------------
Warning: fsockopen(): unable to connect to http://www.rediff.com:80 in c:\ecko\web\test\welcome.php on line 17
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (10060)
a)what is the solution to access that file
b) actually I have written code according the given example at RSSMix php parser
thanks in advance
ravi
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]