Skip to main content
October 14, 2009
Question

Problem with XML built manually from recordset, please help.

  • October 14, 2009
  • 2 replies
  • 537 views

Hi,

I have built XML manually from a recordset as instructed in David Powers book The Essential Guide to Dreamweaver CS3, page 703.

I have also used phpmyadmin to generate XML, page 696. I have attached both pages to this message.

When I tested wedding_manual.php in the browser, it wouldn't display, I just got a white screen. I have checked my php error logs, I get the message displayed below:

PHP parse error: syntax error, unexpected T_STRING in Applications/MAMP/htdocs/mywesite/mywebpage.php on line 43.

I have checked the code on line 43, it's where the XML declaration sits, I can't see anything wrong with the syntax. I deleted it a typed it in again, but there still seems to be a problem. I have also checked my code against japan_manual.php in examples/ch20, and again I cannot see where the problem is, could somebody please help me with this.

Thankyou.

This topic has been closed for replies.

2 replies

DwFAQ
Participating Frequently
October 14, 2009

http://labs.adobe.com/technologies/spry/samples/utils/query2xml.html

Inspiring
October 14, 2009

If your server has short tags enabled in PHP, then it's recognizing the <?----?> in your XML declaration as PHP opening/closing tags, and of course running into a syntax error since what it's finding isn't PHP. The easiest way around that is usually to wrap the XML declaration inside PHP print or echo statements, so it's not processed as PHP. For instance, convert this:

<?xml version="1.0" encoding="utf-8"?>

...to something like:

<?php print('<?xml version="1.0" encoding="utf-8"?>'); ?>

(if the forum renders that OK...)