Кто знает почему скрипт для вывода на web страницу на локалхосте отлично работает а на h15 пишет ошибку?
Скрипт:
<?
class rss{
var $sUrl;
var $sBuff;
var $rXml_parser;
var $aParentField;
var $aCurrrentField;
var $aCurrentNamespace;
var $aRss;
var $aItems;
var $aChannel;
function rss($url=""){
if(!isset($url) || empty($url)){
echo "no RSS url";
exit();
}
$this->aChannel = array();
$this->aItems = array();
$this->aRss = array($this->aChannel, $this->aItems);
$this->aParentField = array();
$this->xml_parser = undef;
$this->sUrl = strval($url);
$this->GetUrl();
$this->ParseRss();
}
function GetUrl(){
$this->sBuff = join ("", file($this->sUrl));
}
function ParseRss(){
$this->rXml_parser = xml_parser_create();
xml_set_object($this->rXml_parser, &$this);
xml_set_element_handler($this->rXml_parser, "starttag", "endtag");
xml_set_character_data_handler($this->rXml_parser, "cdata");
if (!xml_parse($this->rXml_parser, $this->sBuff)) {
die(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($this->rXml_parser)),
xml_get_current_line_number($this->rXml_parser))
);
}
xml_parser_free($this->rXml_parser);
$this->aRss = array("channel" => $this->aChannel, "items" => $this->aItems);
}
function GetArrayRss(){
return $this->aRss;
}
function GetChannelVal($sVal){
return $this->aChannel[$sVal];
}
function GetArrayChannel(){
return $this->aChannel;
}
function GetArrayItem(){
return $this->aItems;
}
function starttag($rXml_parser, $tag, $attributes){
$tag = strtolower( $tag );
$namespace = false;
if ( strpos( $tag, ':' ) ) {
list($namespace, $tag) = split( ':', $tag, 2);
}
$this->aCurrrentField = $tag;
if ( $namespace and $namespace != 'rdf' ) {
$this->aCurrentNamespace = $namespace;
}
if ( $tag == 'channel' ) {
array_unshift( $this->aParentField, 'channel' );
}elseif ( $tag == 'items' ) {
array_unshift( $this->aParentField, 'items' );
}elseif ( $tag == 'item' ){
array_unshift( $this->aParentField, 'item' );
}elseif ( $tag == 'cdatainput' ) {
array_unshift( $this->aParentField, 'cdatainput' );
}elseif ( $tag == 'image' ) {
array_unshift( $this->aParentField, 'image' );
}
}
function endtag($rXml_parser, $tag){
$tag = strtolower($tag);
if ( $tag == 'item' ) {
$this->aItems[] = $this->current_item;
$this->current_item = array();
array_shift( $this->aParentField );
}elseif ( $tag == 'channel' or $tag == 'items' or $tag == 'cdatainput' or $tag == 'image' ) {
array_shift( $this->aParentField );
}
$this->aCurrrentField = '';
$this->aCurrentNamespace = false;
}
function cdata($rXml_parser, $cdata){
if ( $this->aParentField[0] == $this->aCurrrentField || !$this->aCurrrentField ){
return;
}elseif ( $this->aParentField[0] == 'channel') {
if ( $this->aCurrentNamespace ) {
$this->aChannel[ $this->aCurrentNamespace ][ $this->aCurrrentField ] .= $cdata;
}else{
$this->aChannel[ $this->aCurrrentField ] .= $cdata;
}
}elseif ( $this->aParentField[0] == 'item' ){
if ( $this->aCurrentNamespace ) {
$this->current_item[ $this->aCurrentNamespace ][ $this->aCurrrentField ] .= $cdata;
}else{
$this->current_item[ $this->aCurrrentField ] .= $cdata;
}
}elseif ( $this->aParentField[0] == 'cdatainput' ) {
if ( $this->aCurrentNamespace ) {
$this->cdatainput[ $this->aCurrentNamespace ][ $this->aCurrrentField ] .= $cdata;
}else{
$this->cdatainput[ $this->aCurrrentField ] .= $cdata;
}
}elseif ( $this->aParentField[0] == 'image' ) {
if ( $this->aCurrentNamespace ) {
$this->image[ $this->aCurrentNamespace ][ $this->aCurrrentField ] .= $cdata;
}else{
$this->image[ $this->aCurrrentField ] .= $cdata;
}
}
}
}
?>
Вывожу так:
<?
require("./rss.php");
$rssurl = "http://www.flashmaster.ru/rss2.php";
$cRss = new rss($rssurl);
?>
<html>
<head>
<title><?= $cRss->GetChannelVal("title"); ?></title>
</head>
<body>
<h1><?= $cRss->GetChannelVal("title"); ?></h1>
<p><b>Channel title: </b><?= $cRss->GetChannelVal("title"); ?></p>
<p><b>Channel description: </b><?= $cRss->GetChannelVal("description"); ?></p>
<p><b>Channel link: </b><?= $cRss->GetChannelVal("link"); ?></p>
<p><b>Channel pubdate: </b><?= $cRss->GetChannelVal("pubdate"); ?></p>
<hr>
<?
foreach($cRss->GetArrayItem() as $item) {
echo "<p><b>Item title:</b>".$item['title']."</p>";
echo "<p><b>Item description:</b>".$item['description']."</p>";
echo "<p><b>Item author:</b>".$item['author']."</p>";
echo "<p><b>Item pubdate:</b>".$item['pubdate']."</p>";
echo "<p><b>Item link:</b>".$item['link']."</p>";
echo "<hr>";
}
?>
</body>
</html>
ошибка собственно :
Warning: file(
http://www.flashmaster.ru/rss2.php): failed to open stream: Permission denied in /home/h/hvnews.h15.ru/WWW/rss/rss.php on line 35
Warning: join(): Bad arguments. in /home/h/hvnews.h15.ru/WWW/rss/rss.php on line 35