okay, i have a folder OUTSIDE of my root dir. and it contains sound files, now i have a script that calls files from this to download and thats working perfectly, now aim trying to do the same thing, but to hear it sound, so people can sample it before they download the file. heres the code i have so far:
<?php
session_cache_limiter('public');
require_once( "File.php" );
require ("signupconfig.php");
if (!class_exists(auth))
{
include ("./auth.php");
}
include ("./authconfig.php");
include ("./check.php");
$dDir = realpath(dirname(__FILE__)."/../../downloads") . "/";
$dFile = $dDir . $_GET["file"];
if($download) {
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header( "Content-Disposition: attachment; filename=".basename($dFile));
header( "Content-Description: File Transfer");
@readfile($dFile);
}
$filepath = "/../../downloads/$file";
$play_file = $dFile;
$play_file2 = "../../$play_file";
echo "<embed src=\"$play_file\" hidden=no autostart=true></embed><br><br>";
?>
<a href="preview.php?file=<?=$play_file?>&download=TRUE" target="_blank">Download</a> <br><bR>
<?=$play_file?> <br><br> <?=$play_file2?>
now even though the file and everything shows up, i cant get it to play. any ideas or suggestions?
Thanks.