Ok, let me preface this by saying I am relatively new to PHP, but understand programming logic well.
I am having trouble getting this video to display. I have a feeling this is due to my inexperience with headers, and that someone has already made this script a thousand times.
As of right now, this script simply outputs the raw data of the video onto the screen (obviously not what I'm looking for). My goal is to call this script as "video.php?id=19231" (or whatever id number) and have it display that video to the user.
NOTE:: I know for a fact all of the variables are correct and are returning the correct information.
<?php
// Session Security
session_start();
if(!($_SESSION['sid'] == session_id())) {
die('You are not logged in. Please re-login and try your query again.');
}
// Make sure there is an ID passed to us
if(!isset($id)) {
die('No video was requested. If you clicked a search link, this may be an error, please contact support.');
}
$database="XXXX";
$dat_user="XXXX";
$dat_pass="XXXXX";
$dat_table="XXXXXX";
$server="mysql.XXXX.com";
if(!mysql_connect($server,$dat_user,$dat_pass)) {
die('Error connecting to database:' . mysql_error());
}
@mysql_select_db($database) or die("Unable to select database:" . mysql_error());
$query="select * from $dat_table where id like '$id'";
$result=mysql_query($query);
$info=mysql_fetch_array($result);
$path=$info["video_path"];
$title=$info["video_name"];
echo("<html><head><title>$title</title></head><body>");
echo("</body></html>");
@readfile("$path");
?>
Thank you for any help any of you can provide!
--tgmsocal