I have spent ages looking for a good php script which can generate an RSS fairly automatically. The tutorial which is located here on Kirupa seems to be exactly what i’m looking for.
I’m having a problem with it thou. When i execute the file in the browser nothing happens. The fields i want to retrive from the database are: title, date and message.
This is the php code which i am using:
cool nice one, yeah i knew for a while i had a problem with my date. Never got around to fixing it. Thanks for the info about DATE and DATETIME :pleased:
Doesn’t matter if he did. The for’s going to pull out all the data no matter what the id is.
edit:/ @rollo: Did you put anything other than the PHP code on the page? There are HTML tags on the page you provided.
I don’t know if this will help… erm at alll… but try using print($xml_output); rather than the echo. I honestly can’t find a thing wrong with that code, the least it should output is the xml tag.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY></BODY></HTML>
could it be possible that PHP is not compiled with XML support ?
now that you mention it, i did have a previous issue with XMLDOM support with my webhost. They maintain that it is supported but i don’t think it is activated, does the script require xmldom support?
That’s a possiblity. Are you sure that the table is actually CREATED in your database and that you have the corerct information? If it’s dying and not outputing anything, then it of course won’t be echoing out anything at the end.
edit
i tested the script on another one of my servers and it works perfectly. I must get in contact with my webhost and get them to recompile xmldom on the server.
Sorry about the hassle lads and thanks to those for their assistance.
actually, one problem. I wanted to use the xml page for an RSS feed. The problem is that the page is rendering as a .php page. Is there any way that i can get it to render as a .xml page ?