You are here: Help getting this debug.php script to work « PHP « IT news, forums, messages
Help getting this debug.php script to work

Posted by jon on 01/14/06 03:11

I am kind of new to this php programming and after reading the instructions
which came with this rss newsreader program (Magpierss 0.72 ) I am unable to
get it work. If I understand how it suppose to work all what one person has
to do is change the url to a rss feed that you have saved on your site (a
..rss file) and it should displays all the information available from a
parsed feed.
When I try any feed I always get a error. If anyone can explain to me how to
get this to work with a example that really would be appreciated.
thank you


ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);
define('MAGPIE_DIR', '../');
define('MAGPIE_DEBUG', 1);

// flush cache quickly for debugging purposes, don't do this on a live site
define('MAGPIE_CACHE_AGE', 10);


if ( isset($_GET['url']) ) {
$url = $_GET['url'];
else {
$url = '';


$rss = fetch_rss( $url );

if ($rss) {
echo "<h3>Example Output</h3>";
echo "Channel: " . $rss->channel['title'] . "<p>";
echo "<ul>";
foreach ($rss->items as $item) {
$href = $item['link'];
$title = $item['title'];
echo "<li><a href=$href>$title</a></li>";
echo "</ul>";
else {
echo "Error: " . magpie_error();

RSS URL: <input type="text" size="30" name="url" value="<?php echo $url
?>"><br />
<input type="submit" value="Parse RSS">

<h3>Parsed Results (var_dump'ed)</h3>
<?php var_dump($rss); ?>


function test_library_support() {
if (!function_exists('xml_parser_create')) {
echo "<b>Error:</b> PHP compiled without XML support (--with-xml),
Mapgie won't work without PHP support for XML.<br />\n";
else {
echo "<b>OK:</b> Found an XML parser. <br />\n";

if ( ! function_exists('gzinflate') ) {
echo "<b>Warning:</b> PHP compiled without Zlib support (--with-zlib).
No support for GZIP encoding.<br />\n";
else {
echo "<b>OK:</b> Support for GZIP encoding.<br />\n";

if ( ! (function_exists('iconv') and
function_exists('mb_convert_encoding') ) ) {
echo "<b>Warning:</b> No support for iconv (--with-iconv) or multi-byte
strings (--enable-mbstring)." .
"No support character set munging.<br />\n";
else {
echo "<b>OK:</b> Support for character munging.<br />\n";




[Reply to this message]

Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация