PHP Classes

Page Breaks With More Than 235 <item>s In Xml

Recommend this page to a friend!

      SimpleXML for PHP4  >  All threads  >  Page Breaks With More Than 235...  >  (Un) Subscribe thread alerts  
Subject:Page Breaks With More Than 235...
Summary:Xml file with 235 <item>s. 1 more <item> breaks the page.
Messages:2
Author:Joshua Jackson
Date:2011-12-21 15:34:22
Update:2012-02-17 18:50:56
 

  1. Page Breaks With More Than 235...   Reply   Report abuse  
Picture of Joshua Jackson Joshua Jackson - 2011-12-21 15:34:22
Hello...
flcbranson.org/listseries.php
That is the page that loads this xml file...
flcbranson.org/rss/CurrentMessages. ...
It has 235 <item>s and a total of 1661 lines.
It validates with w3 validator.
If I add 1 <item> (even a duplicate of another, so no syntax problem), the page breaks (all white, no html is rendered).
The code, below, is above the html (hence the blank, white, page)...

<?php
// gets a query from the URL and sets a variable that can be used throughout the page
$xml = $_GET["xml"];
$archivelink = $_GET["archivelink"];

// required for PCI compliance
// Remove tags in case hack was sent
$pos = strpos($xml, "<");
// strip tags just in case
if($pos === false) $xml = strip_tags($xml);
// chop off everything from < to end
else $xml = substr($xml,0,$pos);

// SimpleXML for PHP4 (http://www.phpclasses.org/package/4484-PHP-Load-XML-files-in-PHP-4-like-SimpleXML-extension.html)
// SimpleXML is a php5 thing and doesn't work with php4, this makes it work with php4
// this class doesn't support xpath or wildcards
// loads the required file for the backport
require_once "include/simplexml-2011-05-26/simplexml.class.php";
// loads the xml file
$sxml = new simplexml;
if($xml) $data = $sxml->xml_load_file("rss/".$xml);
else $data = $sxml->xml_load_file("rss/CurrentMessages.xml");
?>

Is there a problem with the number of <item> or the number of lines? I would think that the class could handle a much larger file that I'm sending it.
JJ

  2. Re: Page Breaks With More Than 235...   Reply   Report abuse  
Picture of Taha Paksu Taha Paksu - 2012-02-17 18:50:56 - In reply to message 1 from Joshua Jackson
are you trying this on localhost or remote? isn't there any error shown in the page? if you tried this on remote server, please try it on local and maybe it'll produce some error messages.