學校首頁中放置ostube最新影片

直接取得ostube最新影片,可放在學校首頁

須將flvplayer.swf檔案複製到ostube的資料夾中


將底下程式複製到文字編輯器中,存成php檔,再檔案複製到ostube的資料夾中

<?php
 $dbhost = 'localhost';
 $dbuser = 'root';
 $dbpass = '12345678';
 $dbname = 'ostube';
 $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die('Error with MySQL connection');
 mysql_query("SET NAMES 'utf8'");
 mysql_select_db($dbname);

//sql語法,取得最近一筆
 $sqlstr = "select media_id, media_title, media_convert_extention, media_key from ost_media where media_convert_extention='flv' order by media_id desc limit 1" ;
 $rows = mysql_query ($sqlstr);

//顯示資料
 ?>
<p align="center"><object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" height="130" width="120" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">

<param value="high" name="quality"/>

<param value="flvplayer.swf?file=media/video/<?php while (list($a1, $a2, $a3, $a4)=mysql_fetch_row($rows)) { $b2=$a2; $b4=$a4; echo "$a1.$a3";} ?>" name="movie"/></object><br/>

<a target="_blank" href="http://163.22.85.3/ostube/mediadetails.php?key=<?php echo "$b4"; ?>"><?php echo "$b2"; ?></a>


學校首頁我則是利用

<iframe height="210" src="http://163.22.85.3/ostube/test001.php" width="160" align="left" > </iframe>

留言

這個網誌中的熱門文章

十四、NAS4Free 新增一ZFS磁碟機