PHP XML HTML Backup for Flash


/ Published in: PHP
Save to your folder(s)

You can use this code under MIT licence.


Copy this code and paste it in your HTML
  1. function readXML($arg, $type)
  2. {
  3. $i=0;
  4. $xml = simplexml_load_file($arg);
  5.  
  6. if($type=='main'){
  7. foreach($xml->children() as $child) {
  8. if($child->getName()=="item"){
  9. echo "<h3>" . $child->title . "</h3>";
  10. if($i==0)
  11. readXML('http://localhost/wordpress/?mode=xml&xmlfile=rotator.php&page=1', 'images');
  12. $i++;
  13. }
  14. }
  15. }
  16. if($type=='images'){
  17. $aux = '<div id="coinslider">';
  18. foreach($xml->children() as $child)
  19. {
  20. if($child->getName()=="item")
  21. {
  22. $aux = $aux . '<img src="' . $child->file . '"/>';
  23. }
  24. }
  25. $aux = $aux . '</div>';
  26. echo $aux;
  27. }
  28. }
  29.  
  30. readXML("http://localhost/wordpress/?mode=xml", "main");

URL: http://digitalzoomstudio.net

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.