This script will work fine on my WAMP dev server but on the live Linux server I am getting 500 server errors.
The whole point of the script is to keep users from downloading the flv I send to a swf player. Below is my code.
AddType application/x-httpd-php .flv
[code]<?php session_start(); ?> Untitled Document <?php $_SESSION['isFair'] = "Yes"; ?> [/code]
video.flv - Found this script here
if($_SESSION[‘isFair’] == “Yes”)
$filename = “flv/01.flv”;
header(‘Length: ’ . filesize($filename));
header(‘Content-Disposition: attachment; filename="’.$filename.’"’);
$fd = fopen($filename, “r”);
echo fread($fd, filesize($filename));
echo “Stealing is not allowed”;
I checked my server log and it says
file has no execute permission: (video.flv) so I give it execute permission. Then I get the error
file is writable by others: (video.flv), I take away write permissions and I still get error 500 and “Premature end of script headers:” is put in the log.
Any help will be greatly appreciated.