How do I get PHP to mimic an XML when doing AJAX?

Dan S

New member
If you have the correct level of access to the server you can tell it to interpret files with .xml extension as .php...
I'm not sure if that solves your problem
To me, it sounds like your problem is that you're not making the XML file correctly.
Have the .php file write an XML file and display it with the .php extension, then copy that into an XML file and run that file as .xml and see if it works like that.
If it does then your diagnosis on the problem is correct...but to me it sounds like you're missing the "<" like it says :P
 
I'm trying to make an AJAX page, but having a problem. See, I'm attempting to build the XML page using PHP, but not have to save a million XML files all over my webserver. So...

1. I don't want to save an XML file for every new login...
2. I want to make the XML render dynamically within a PHP page...
3. The only way to get the server to render the PHP page is by giving it the .PHP extension...
4. When I give it the .PHP extension, the XML script returns this error;
Warning: DOMDocument::load() [function.DOMDocument-load]: Start tag expected, '<' not found in /var/www/getxml.php

How do I get PHP to pretend to be an XML without giving me that error?
The problem with that error, if I had to guess, is that the PHP parser is not parsing the page before the XML reader gets to it, since they're both on the server. And since there's only one PHP tag, there are no XML tags. But this is for a login script. I can't build a new XML file for each login right? What if people close the browser instead of logging out? I can't delete their file then.
 
Back
Top