Hi. I'm working on having a DB that stores video's with the web location. Then, it will use the location in a html file to load an embedded media player to play the file. However, i'm new to PHP so i'm not exactly sure what to do. I'll include the code that i have at the moment and try to explain what i'm doing.
The "playfile.php" is the first below. (hopefully this is correct but...) It connects to the database and makes a displayed link of the video names in the DB (through the else statement because the if is false the first run). Then, depending on which link you click, it runs the initial if getting the location of that video.
Now, i need it to load an embedded media play playing the file for the video. I had this in a second php file that i needed to pass the location to. This is where i have problems. I do not know how to load up the new page, send the location, and have the location as noted by "filelocation" in the second part below. Any help would be greatly appreciated.
FIRST FILE
<body>
<?php
$db = mysql_connect("localhost", "user", "pw");
mysql_select_db("testDB",$db);
// display individual record
if ($id) {
$result = mysql_query("SELECT FROM kwmv WHERE id=$id",$db);
$myrow = mysql_fetch_array($result);
$temp = $myrow["location"];
// if($temp) {
// header("location: playfile2.php?location=$temp");
// }
} else {
// show employee list
$result = mysql_query("SELECT FROM kwmv",$db);
if ($myrow = mysql_fetch_array($result)) {
// display list if there are records to display
do {
printf("<a href=\"%s?id=%s\">%s</a><br>\n", $PHP_SELF, $myrow["id"], $myrow["vidname"]);
} while ($myrow = mysql_fetch_array($result));
} else {
// no records to display
echo "Sorry, no records were found!";
}
}
?>
SECOND PHP FILE
<HEAD>
<TITLE>Embedded Windows Media Player Control</TITLE>
</HEAD>
<BODY>
<OBJECT ID="Player" width="640" height="480"
CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
<PARAM name="autoStart" value="True">
<PARAM name="URL" value="filelocation">
<PARAM name="uiMode" value="mini">
</OBJECT>
<href="http://www.microsoft.com/windows/windowsmedia/en/default.asp">
<P><font size="3">Return to MENU</font></a></p>
</P>
</BODY>
BTW, the media embedded code is correct (but for the correct url value) and the php properly retrieves the info from the database.