i am working on a bit of code that will play an embedded video.
this is what i have currently.
when i select a movie my selection does continue and the movie doesnt start.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
$showForm = 1;
if(isset($_POST['Submit'])) {
$showForm = 0;
?>
<OBJECT ID="MediaPlayer" WIDTH=320 HEIGHT=42
CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
STANDBY="Loading Windows Media Player components..."
TYPE="application/x-oleobject">
<PARAM NAME="<?php $file ?>FileName" VALUE="<?php "'$path' . '$file'"?>">
<EMBED TYPE="application/x-mplayer2"
SRC="<?php "'$path' . '$file'" ?>"
NAME="MediaPlayer"
WIDTH=320
HEIGHT=42>
</EMBED>
</OBJECT>
<?php
}
if ($showForm == 1) {
//define the path as relative
$path = "movies/";
//using the opendir function
$dir_handle = @opendir($path) or die("Unable to open $path");
echo "Directory Listing of $path<br/>";
//running the while loop
echo"<select>";
while ($file = readdir($dir_handle))
{
if($file!="." && $file!="..")
echo " <option value='$file'>$file</option>";
}
echo"</select>";
//closing the directory
closedir($dir_handle);
echo "<form action='".$_SERVER['php_self']."' method='post' >";
$_POST[$file];
echo" <button type=\"submit\" name=\"Submit\" value=\"0\">Push Me</button>";
echo" <input type=\"submit\" />";
echo"</form>";
}
?>
</body>
</html>
Bookmarks