Hi,
I'm a super newbie to php, but I'm trying to learn. So please forgive me if I won't be too much precise, but I'm speaking about an argument I barely know (PHP) and in a foreing language (I'm italian) .
So, here's my problem.
I'm building a really simple website for a shortmovie filmfestival that me and my friends are organizing. I'd like to add the possibility to watch our shortmovies on the website, so I want to add a media player. That's what I did:
on the database I added a table that lists all the shortmovies, a column of the table concerns the file name for the movie: e.g. title = "ciao" [...] file = "ciao.flv".
to see if everything worked fine, and to train a little bit coding I wrote some php code in order to show the file name once a shortmovie is selected:
<?php
include ("misc/incre.inc");
/ TO GET THE TITLE OF THE MOVIE CHOSEN /
$title = $_GET['title'];
$cxn = mysqli_connect($host,$user,$password,$database)
or die ("Impossibile connettersi al server.");
$query = "SELECT file FROM shortmovies WHERE title LIKE '$title'";
$result = mysqli_query($cxn,$query)
or die ("Impossibile eseguire la richiesta.");
$row = mysqli_fetch_assoc($result);
$file = $row['file'];
echo "$file";
?>
[/QUOTE]
- Ok, that seems to work. Now I have to add the media player, and here's is where I don't have any idea. Luckly, Dreamweaver provides some help, since has the option to directly insert a mediaplayer with few clicks. The point that he does that only for a single file, but I want to use the mediaplayer for all the possible movie chosen to play... Anyway, this is the bunch of code that Dreamweaver add when I create the mediaplayer for the file "ciao.flv":
<script type="text/javascript">
function MM_CheckFlashVersion(reqVerStr,msg){
with(navigator){
var isIE = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
if (!isIE || !isWin){
var flashVer = -1;
if (plugins && plugins.length > 0){
var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
if (desc == "") flashVer = -1;
else{
var descArr = desc.split(" ");
var tempArrMajor = descArr[2].split(".");
var verMajor = tempArrMajor[0];
var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
flashVer = parseFloat(verMajor + "." + verMinor);
}
}
// WebTV has Flash Player 4 or lower -- too low for video
else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;
var verArr = reqVerStr.split(","); var reqVer = parseFloat(verArr[0] + "." + verArr[2]); if (flashVer < reqVer){ if (confirm(msg)) window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"; } }
}
}
</script></head>
<body onload="MM_CheckFlashVersion('8,0,0,0','Content on this page requires a newer version of Macromedia Flash Player. Do you want to download it now?');"><object classid="clsid
27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="180" height="135" id="FLVPlayer">
<param name="movie" value="FLVPlayer_Progressive.swf" />
<param name="salign" value="lt" />
<param name="quality" value="high" />
<param name="scale" value="noscale" />
<param name="FlashVars" value="&MM_ComponentVersion=1&skinName=Clear_Skin_2&streamName=corti/ciao&autoPlay=false&autoRewind=false" />
<embed src="FLVPlayer_Progressive.swf" flashvars="&MM_ComponentVersion=1&skinName=Clear_Skin_2&streamName=corti/ciao&autoPlay=false&autoRewind=false" quality="high" scale="noscale" width="180" height="135" name="FLVPlayer" salign="LT" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</body>
Ok... now I don't get ANY of that... but I think I should modify something in the middle, in order to make it load not a specific file, but the file .flv corresponding to the shortmovie chosen on the previous page.
Can somebody help me? I'm running late, the filmfestival is in august, and I'd like to launch the website at the end of june... thanks a lot! Really!
Ricroma