Create rss feed of php loop?

Discussion in 'PHP' started by sanyi007, Dec 13, 2010.

  1. #1
    Hi all!

    I am looking for a way, to save a php loop from php to an rss feed (into an xml file if possible, as i don't want to run the script every time people access the feed, only once an hour to rebuild it)

    So here it is: the php loop is a while loop. The variables that i would like to save:
    There are 3 variables, a direct link to an image, an image title and a href document. I would like an xml, where only the image is showing, and if someone clicks on it it loads the href.

    So basically i want this html code the same way in a working xml, and all the images should be below the other.
    <a href="something.html"><img src="image" title="imagetitle" \> </a>
    HTML:
    This would be the first rss i will create, every advice is appreciated.
    Thanks.
     
    sanyi007, Dec 13, 2010 IP
  2. olddocks

    olddocks Notable Member

    Messages:
    3,275
    Likes Received:
    165
    Best Answers:
    0
    Trophy Points:
    215
    #2
    Lets say you have xml file made of 3 variables..

    <href> holds the link
    <img> holds the image
    <imageTitle> holds the image title


    You will need to create .xml file first and later
    set apache to parse php code in xml files through .htaccess. of course ! inside xml file you can place php code which creates the looped xml data.

    In .htaccess

    Be sure to read through below on how to do it:
    http://www.ibm.com/developerworks/xml/library/x-phprss/
    http://forums.digitalpoint.com/showthread.php?t=32265
     
    olddocks, Dec 13, 2010 IP
  3. sanyi007

    sanyi007 Peon

    Messages:
    189
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks for the tips and links, i will look into it!
     
    sanyi007, Dec 14, 2010 IP