Maison >développement back-end >tutoriel php >视频网站的制作例子二_PHP教程
<?xml version="1.0" encoding="utf-8"?> <application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <vbox backgroundcolor="white" width="400" height="335"> <videodisplay width="400" height="300" id="videoPlayer" source="{Application.application.parameters.movie}"></videodisplay> <hbox width="100%" horizontalalign="center"> <button label="Play" click="videoPlayer.play()"></button> </hbox> </vbox> </application>
<h5>Listing 5. simptest.php</h5><pre class="brush:php;toolbar:false"><?php require "DB.php"; $moviebase = 'http://localhost:8080/movies/'; $dsn = 'mysql://root@localhost/movies'; $db =& DB::connect( $dsn ); if ( PEAR::isError( $db ) ) { die($db->getMessage()); } $source = null; $movieId = 1; if ( array_key_exists( 'movie', $_GET ) ) $movieId = $_GET['movie']; $movies = array(); $res = $db->query( 'SELECT movieId, source, title FROM movies' ); while( $row = $res->fetchrow( ) ) { $movies []= $row; if ( $row[0] == $movieId ) $source = $row[1]; } if ( $source == null ) $source = $movies[0][1]; ?>
|