Forum Moderators: coopster

Message Too Old, No Replies

please help me with php

         

pklover

7:05 am on Mar 17, 2010 (gmt 0)

10+ Year Member



i have search this php code by net and this not work in my site can any help and correct this

<?php
if($_SERVER['DOCUMENT_ROOT']=="/home/user/public_html"){
$flv=array(
'1' => 'video1.flv',
'2' => 'video2.flv',
'3' => 'video3.flv',
'4' => 'video4.flv',
'5' => 'video5.flv'
);
readfile ($flv[$_GET['tv']]);
}else{
header("Location: mysite.com/sorry.flv");
}
?>

mack

7:24 am on Mar 17, 2010 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



What errors are you getting, and what do you want it to do?

Mack.

g1smd

7:30 am on Mar 17, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Using a 302 redirect to redirect to an error message explaining that a file is not available is not a very good idea.

The script should directly return a 404 header and simply INCLUDE the HTML and text of the error document.