roccochiolo Inserito: 27 giugno Segnala Inserito: 27 giugno buonasera a tutti sto usando una classe per la creazione dei feed rss ma appena si apre stampa errore e non riesco a capire dove sta l errore , perche la stessa classe se la metto dentro un files e la apro dal browser funziona .... Quote This page contains the following errors: error on line 19 at column 6: XML declaration allowed only at the start of the document Below is a rendering of the page up to the first error. function xmlentities ( $string ) { $ar1 = array ( '&' , '"', ''' , '<' , '>' ); $ar2 = array ( '&', '"', "’", '<', '>' ) ; return str_replace ( $ar1 , $ar2, $string ); } global $settings ; $rss = new UniversalFeedCreator(); $rss->useCached(); // use cached version if age<1 hour $rss->title = "PHP news"; $rss->description = "daily news from the PHP scripting world"; //optional $rss->descriptionTruncSize = 500; $rss->descriptionHtmlSyndicated = true; $rss->link = "http://www.dailyphp.net/news"; $rss->syndicationURL = "http://www.dailyphp.net/".$_SERVER["PHP_SELF"]; $image = new FeedImage(); $image->title = "dailyphp.net logo"; $image->url = "http://www.dailyphp.net/images/logo.gif"; $image->link = "http://www.dailyphp.net"; $image->description = "Feed provided by dailyphp.net. Click to visit."; //optional $image->descriptionTruncSize = 500; $image->descriptionHtmlSyndicated = true; $item = new FeedItem(); $item->title = 'XXXX'; $item->link = 'VVVV'; $item->description = 'XXXX'; //optional $item->descriptionTruncSize = 500; $item->descriptionHtmlSyndicated = true; $item->date = time(); $item->source = "http://www.dailyphp.net"; $item->author = "John Doe"; $rss->addItem($item); echo $rss->saveFeed("RSS2.0", "../rss/feed.xml"); grazie
roccochiolo Inserita: 30 giugno Autore Segnala Inserita: 30 giugno Salve nessuno riesce a darmi una mano? Saluti Rocco
Livio Orsini Inserita: 30 giugno Segnala Inserita: 30 giugno 2 ore fa, roccochiolo ha scritto: Salve nessuno riesce a darmi una mano? Quasi certamente tra chi ha letto la discussione non c'è alcuno che sappia, possa evoglia rispondere.
Messaggi consigliati
Crea un account o accedi per commentare
Devi essere un utente per poter lasciare un commento
Crea un account
Registrati per un nuovo account nella nostra comunità. è facile!
Registra un nuovo accountAccedi
Hai già un account? Accedi qui.
Accedi ora