Video Site Production example three

Source: Internet
Author: User

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> 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.