Greetings!
I use this product a lot in my websites and have always found answers before, but I have a new question that does not seem to have appear in the forum.
Are there server requirements for Magic Parser, beyond simply running PHP? Here is why I ask:
I have a website with various pages that pull copy content from a single XML document. It parses correctly on my php server, but when I upload THE EXACT SAME FILES to my client's php server, the content area is blank. Any idea why that might be?
XML File: {link saved}
Page loading correctly on my server: {link saved}
Exact same page on client's server: {link saved}
Basically, on the client server, it will only parse the first section (homepage) and beyond that, it does not recognize the format string. Here is my code:
<?php
require('inc/MagicParser.php');
$pageName = '';
$copy = '';
function myRecordHandler($record){
global $pageName, $copy;
$pageName = $record["PAGE-NAME"];
$copy = $record["PAGE"];
if($_GET['p'] == NULL){
echo $copy."\n";
}
$i = 0;
while(1) {
if ($i) $postfix = "@".$i;
if (!isset($record["PAGE".$postfix])) break;
$pageName = $record["PAGE".$postfix."-NAME"];
$pageCopy = $record["PAGE".$postfix];
if(strstr($_GET['p'], $pageName)) {
echo $pageCopy;
}
$i++;
}
}
MagicParser_parse('copy.xml',"myRecordHandler","xml|SITE/LIBRARYPLACE/"); // pulls up nothing
?>
On the homepage, content parses correctly with "HOME" in the format string -- but nothing else seems to work. I don't see any problems with my XML, do you??
Thanks for your time and for a great product! Though this site could use a little help :)
Hello Marcy,
Apologies for the delay getting back to you.
I notice from the links that it now appears to be working - let me know if you still need any help with this...
Cheers,
David.