Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
rss from dynamic page?
#1
anyone know a way to generate valid rss files from dynamic (php/mysql) web pages? and if not, maybe we could say - rss from plain old html.
Reply
#2
Create a separate file called "indexrss.php" (or whatever)
Iterate over your mysql results and create the xml instead of html.
You will need to set the content type to xml with a header('Content-type: text/xml') directive.
Optionally, you can add to your HTML page's head section.
Reply
#3
Ah, Seacrest...you make it all look so simple.

You are my web design hero! (really!)
Reply
#4
Seacrest is the champion, for sure.

But your humble servant doesn't quite understand the
header('Content-type: text/xml')
bit

if under normal circumstances, a file called feed.rss begins with:



do you mean that this should be placed on the first line, above those two lines?:
;
Reply
#5
eh

I figured it out...

this goes first:


then:
any queries/other php header stuff

then:

....

while deliberately leaving out this:
Reply
#6
All headers must be sent before any data is output to the browser, so yeah.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)