The the "I" starts right when I open the page. As I select each movie from the "Right," the page reloads and shows the movie I selected.
How sweet and simple is that? One Flex file, one PHP file, and a little database magic for the backend, and viola! Video sharing!
The next step are to the whether you can enhance the user experience a bit by doing more of the work in Flex.
The Flex Interface, part 1
If you are want to provide a mechanism for Flex to show any movie, your must provide the Flex application with the list of movi Es. The most convenient way to does is through XML. So, going back to PHP again, your need a page exports the movie list from the database as XML. This movies.php the page is shown in Listing 6.
Listing 6. movies.php
<?php require "db.php";
$moviebase = ' http://localhost:8080/movies/';
Header (' Content-type:text/xml ');
$dsn = ' mysql://root@localhost/movies ';
$db =& Db::connect ($DSN); if (Pear::iserror ($db)) {die ($db->getmessage ());}?> <movies> <?php $res = $db->query (' SELECT tit
Le, source, thumb, width, height from movies '); while ($row = $res->fetchrow ()) {?> <movie title= "<?php Echo ($row [0])?>" source= "<?php Echo ($mo Viebase. $row [1])?> "thumb=" <?php Echo ($moviebase. $row [2])?> "width=" <?php Echo ($row [3])?> "h Eight= "<?php Echo ($row [4])?>"/> <?php}?> </movies>