Page 1 of 1

The XML Page Cannot Be Displayed

PostPosted: 01. September 2010 09:21
by Conor Hyland
Hi Folks,

Just installed the latest version of XAMPP for Windows.
Running the following simple PHP script that connects to another servers XML tree and test that everything works OK:

<?php
$fp = fsockopen('XXX.XXX.XXX.XXX', 'XXXX', $errno, $errstr, 60);
if(!$fp)
{
$success = 1;
}
if($success != 1)
{
fputs($fp, "get /admin.cgi?pass=XXXXXXXX&mode=viewxml http/1.0\r\nuser-agent:(Mozilla Compatible)\r\n\r\n");
while(!feof($fp))
{
$page .= fgets($fp,1000);
}
fclose($fp);
}
$loop = array(SERVERTITLE, WEBHITS);
$y = 0;
while($loop[$y] != '')
{
$pageed = ereg_replace(".*<$loop[$y]>", "", $page);
$phpname = strtolower($loop[$y]);
$$phpname = ereg_replace("</$loop[$y]>.*", "", $pageed);
$y++;
}
echo $servertitle;
?>

But unfortunately I get the following error when going to view the page in IE8 and IE7 from various PCs:

The XML page cannot be displayed
Cannot view XML input using style sheet
Please correct the error and then click the Refresh button, or try again later
Invalid at the top level of the document
Error processing resource 'http://XXX.XXX.XXX.XXX/temp.php'. Line 1, Position 1
HTTP/1.0 200 OK

I have Apache 2.2.14 / PHP 5.2 installed on another machine and the above script works perfectly!
I am wondering what could be causing the error - is there something I need to change in the Apache config file? :?
Have tried to view this test page from different PCs but still get the same error. :(

Any help would be greatly appreciated,
Thanks,
Conor

Re: The XML Page Cannot Be Displayed

PostPosted: 01. September 2010 15:11
by JonB
what happens when you open it on the XAMPP machine as http://localhost?

what happens in say -- Firefox, Chrome or Safari?

and then there is this:

The XML page cannot be displayed
Cannot view XML input using style sheet

Invalid at the top level of the document

could be a missing file or an error with a DTD.

my 'guess' is this is not really a XAMPP specific problem, but I have for sure been wrong before... :shock:



Good Luck

Re: The XML Page Cannot Be Displayed

PostPosted: 02. September 2010 02:21
by Conor Hyland
Hi JonB!

Thanks for your reply! :)

When I open it on the XAMPP machine as http://localhost/temp.php it still comes up with the same error in IE8.
In Safari / Chrome & Firefox it comes up with the following:

HTTP/1.0 200 OK Content-Type:text/xml ]>17201824Top 40 Pop Dance Rockhttp://XXX.XXX.XXX.XXX:XXXXHit Radio 247 - Your Non Stop Hit Music Station!

This is basically a load of data back from the xml tree of the server instead of just the variable I want to echo ($servertitle), which should output just the following:

Hit Radio 247 - Your Non Stop Hit Music Station!

I can't for the life of me figure out why this is happening! :?

On Server 192.168.1.4 (Apache 2.2.14 / PHP 5.2.12 / MySQL Community Server 5.1.48 / phpMyAdmin 3.3.4):

It will output the variable ($servertitle) as "Hit Radio 247 - Your Non Stop Hit Music Station!" regardless of what browser I view it in and regardless whether I use localhost or the IP address of the server.

This is exactly what the script should do!

But on Server 192.168.1.2 (Latest Version Of XAMPP) it will output the page as the above error in IE8 and as the following in every other browser:

HTTP/1.0 200 OK Content-Type:text/xml ]>17201824Top 40 Pop Dance Rockhttp://XXX.XXX.XXX.XXX:XXXXHit Radio 247 - Your Non Stop Hit Music Station!

When I view http://192.168.1.4/temp.php in IE8 on the XAMPP machine it works perfectly! :?

This I would imaging should rule out IE8 as being the cause of the problem and would suggest it has something to do with the XAMPP installation itself, either a change to a config file in Apache / PHP or a missing file or something. :(

Any more help would be greatly appreciated,
Thanks,
Conor

Re: The XML Page Cannot Be Displayed

PostPosted: 02. September 2010 04:01
by JonB
Now that I have 'more' details

It appears to me what you are saying is this:

The XAMMP machine is returning the correct values, but for some reason it is also including (echoing) connecxtion/source status information when it outputs the otherwise correct information :?: :?: :?:

Are you still getting any error reports in the Apache log?

like the one about CSS?

Find/locate the CSS file - if there are elements that have been tagged as display: none, AND you are still getting a CSS error - the problem is that the CSS file is either not being found by the server or is not being rendered as CSS.

my best guess-timate

:roll: