Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: loading xml into an html page
12-07-2008, 01:22 PM #1
- Join Date
- Dec 2008
- Thanked 0 Times in 0 Posts
loading xml into an html page
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.
12-07-2008, 05:56 PM #2
- Join Date
- Oct 2008
- Long Beach
- 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 ;)