Forum Moderators: coopster

Message Too Old, No Replies

Php xml windows 2008 server

         

rikflora

6:56 pm on Jul 9, 2010 (gmt 0)

10+ Year Member


i have a partners.php page the has an includes that feeds from another page: part.php.

Part.php pulls info from an xml page that is called partners.xml


Everything work great locally and on a linux server. but when my client loaded it onto their windows 2008 server it stop working. in the section where you should see an image and a link i see what i assume is and error.


here is the code from each page as well as the error message i am getting.

Can anyone help or at least point me in a direction?

partners.php
<?php include("part.php"); ?>

part.php
<?
$objDOM = new DOMDocument();
$objDOM->load("partners.xml");


$note = $objDOM->getElementsByTagName("note");
foreach( $note as $value )
{
$tasks = $value->getElementsByTagName("tasks");
$task = $tasks->item(0)->nodeValue;


$details = $value->getElementsByTagName("details");
$detail = $details->item(0)->nodeValue;

$images = $value->getElementsByTagName("images");
$image = $images->item(0)->nodeValue;
echo '<img src="'.$image.'">';
echo "$task :: $detail <br>";
}


?>

Partners.xml

<mynotes>
<note>
<details><![CDATA[
<a href="Http://www.google.com" target="_blank">google </a>]]></details>
<images> images/logos/logo1.jpg</images>
</note>
</mynotes>

]Error on page

load("partners.xml"); $note = $objDOM->getElementsByTagName("note"); foreach( $note as $value ) { $tasks = $value->getElementsByTagName("tasks"); $task = $tasks->item(0)->nodeValue; $details = $value->getElementsByTagName("details"); $detail = $details->item(0)->nodeValue; $images = $value->getElementsByTagName("images"); $image = $images->item(0)->nodeValue; echo ''; echo "$task :: $detail
"; } ?>

Demaestro

6:59 pm on Jul 9, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



In order to debug what is happening it would help a lot of you included the error from the logs.

I assume it was a 500 internal server error, but what error message was recorded in the logs?

Once you have the error message it will be a lot easier to help fix

rikflora

7:03 pm on Jul 9, 2010 (gmt 0)

10+ Year Member



The error log did not show anything. It is just that in the Div where if content should have showed up i get that text instead. I don't know if its in the code or it is a server permissions issue. I am not sure where to start.

thanks for responding so quickly

Matthew1980

7:05 pm on Jul 9, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi there rikflora,

Welcome to the forum,

Different servers, means there are different ini files in use, and I see that for the include you use full tags (<?php) and for part.php you use the short tag (<?) not all server setups support the short style tag, so my first thing to do would be to add the <?php to the tag - a simple thing like that will help when you change servers :)

I can't see anything obvious after glancing through the code, but I just thought I would mention the tags issue.

Cheers,
MRb

rikflora

7:09 pm on Jul 9, 2010 (gmt 0)

10+ Year Member



Thanks Matthew i will try that and let you know how it works out.


rik

rikflora

8:40 pm on Jul 9, 2010 (gmt 0)

10+ Year Member



Matthew1980

that did the trick.
thank you very much.
now i will figure out how to close this thread and then dance a jig!

Matthew1980

9:32 pm on Jul 9, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi there rikflora,

No problem.

Well, at least this time it was an easy fix ;) I tend to advocate the use of full tags in this forum a lot precisely for this reason - so I am glad as it has proven correct in this instance.

lol! No need to dance though, a beer would do methinks ;)

Cheers,
MRb