Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post loading xml into an html page

    Hi all.

    I am very new to website designing and have no primary knowledge of coding.

    I am wondering if it is possible to load random content from an xml file into a div tag in an html page?

    The reason for me asking is that I am wanting to load testimonials into an area on my site(which I have not built yet) so that they change either on load or one for every day. Just to give my site some dynamic content.

    Or if anyone knows away I can do this in an easier or more effective way please can you say.

    Thanks in advance.

    C.

  • #2
    Senior Coder
    Join Date
    Oct 2008
    Location
    Long Beach
    Posts
    1,196
    Thanks
    36
    Thanked 164 Times in 164 Posts
    PHP has an excellent object made just for that: simplexml_load_file

    This'll show you how to use it as a function to pull in a file: http://us.php.net/manual/en/function...-load-file.php

    For your purposes I would suggest creating a separate PHP file for your testimonials that updates whenever you want it to, then all your other pages on your website that want to utilize those testimonials can AJAX that central page into their own.
    Feel free to e-mail me if I forget to respond ;)
    ohsosexybrit@gmail.com


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •