Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on May 8th, 2013  |  syntax: None  |  size: 0.56 KB  |  views: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <film>
  2.     <title>Great Movie</title>
  3.     <link>http://imdb.com/#</link>  
  4.     <poster>img-name</poster>
  5.     <year>2012</year>
  6. </film>
  7.        
  8. <ul>
  9. <?php
  10. $xml = new SimpleXMLElement ('database.xml',NULL,true);
  11. foreach($xml->film as $movie)
  12. {
  13.  
  14. echo "<li>n";
  15. echo "<div class="film_container">n";
  16. echo "<div class="poster">n";
  17. echo "<a href="".$movie->link.""><img src="img/".$movie->poster.".jpg" /></a>n";
  18. echo "</div>";
  19. echo "<div class="info">n";
  20. echo "<h2>".$movie->title."</h2>n";
  21. echo "<p>".$movie->year."</p>n";
  22. echo "</div>n";
  23. echo "</div>n";
  24. echo "</li>n";
  25.  
  26. }
  27. ?>
  28. </ul>
clone this paste RAW Paste Data