jaymc Posted November 7, 2006 Share Posted November 7, 2006 Right, I am trying to make a system on my website that can play .wma files via the <embed> tag but stop people downloading them.Here is my embed code...[code]<embed src=http://192.168.1.10/site/streaming.jaydiocity.co.uk.php?streaming-audio-mp3-mega-route10mx-jaydiocity-co-uk=193/3207.wma></embed>[/code]And here is the php code...[code]<?$User_Session = $_SESSION['username'];if ($User_Session == "") {die("HAHA");}else { $file = $_GET['streaming-audio-mp3-mega-route10mx-jaydiocity-co-uk']; if (strstr($file, "../")) {die("Nice try wise guy!");} header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: audio/x-mpeg"); readfile("../AuDiO/$file");}?>[/code]Now, I hope you can see exactly how Im going about this by reading my code above... anyway... that is working great ! If I use .htaccess to disable .wma access the system still works and users cant directly download... GREAT!However, I am also using .wax to play a list of songs consecutively (wax is a playlist file, similar to m3u)The wax file looks something like this[code]<ASX version = 3.0><Title>Blink 182 - Enema Of The State Complete Album</Title><Entry><Ref href="708.wma" /></Entry><Entry><Ref href="709.wma" /></Entry><Entry><Ref href="710.wma" /></Entry><Entry><Ref href="711.wma" /></Entry><Entry><Ref href="712.wma" /></Entry></Entry></asx>[/code]Now hopefully you are straight onto the fact that the wax file will essentially be directly downloading the wma, and as .htaccess is disabling wma files, it wont work!Fair enough, so I amended the wax file to the below[code]<ASX version = 3.0><Title>Ashlee Simpson - Autobiogpophy Complete Album</Title><Entry><Ref href="../../site/streaming.jaydiocity.co.uk.php?streaming-audio-mp3-mega-route10mx-jaydiocity-co-uk=26/400.wma" /></Entry><Entry><Ref href="../../site/streaming.jaydiocity.co.uk.php?streaming-audio-mp3-mega-route10mx-jaydiocity-co-uk=26/401.wma" /></Entry><Entry><Ref href="../../site/streaming.jaydiocity.co.uk.php?streaming-audio-mp3-mega-route10mx-jaydiocity-co-uk=26/402.wma" /></Entry><Entry><Ref href="../../site/streaming.jaydiocity.co.uk.php?streaming-audio-mp3-mega-route10mx-jaydiocity-co-uk=26/403.wma" /></Entry><Entry><Ref href="../../site/streaming.jaydiocity.co.uk.php?streaming-audio-mp3-mega-route10mx-jaydiocity-co-uk=26/404.wma" /></Entry><Entry><Ref href="../../site/streaming.jaydiocity.co.uk.php?streaming-audio-mp3-mega-route10mx-jaydiocity-co-uk=26/405.wma" /></Entry><Entry><Ref href="../../site/streaming.jaydiocity.co.uk.php?streaming-audio-mp3-mega-route10mx-jaydiocity-co-uk=26/406.wma" /></Entry><Entry><Ref href="../../site/streaming.jaydiocity.co.uk.php?streaming-audio-mp3-mega-route10mx-jaydiocity-co-uk=26/407.wma" /></Entry><Entry><Ref href="../../site/streaming.jaydiocity.co.uk.php?streaming-audio-mp3-mega-route10mx-jaydiocity-co-uk=26/408.wma" /></Entry><Entry><Ref href="../../site/streaming.jaydiocity.co.uk.php?streaming-audio-mp3-mega-route10mx-jaydiocity-co-uk=26/409.wma" /></Entry></asx>[/code]However, that doesnt work. In theory it should... I think, but it doesntIm just wondering if anyone has any ideas or info about this. Im completely lost, I thought I had it sussed but this .wax accessing the wma's is causing a real headacheHope someone has takin the time to read all that, I know it my be confusing but its not if you can get your head around itCheers! Quote Link to comment https://forums.phpfreaks.com/topic/26401-sort-of-php/ Share on other sites More sharing options...
btherl Posted November 7, 2006 Share Posted November 7, 2006 Perhaps the $_SESSION test is failing? I wouldn't count on cookies being sent for the files specified in the wmx file. Quote Link to comment https://forums.phpfreaks.com/topic/26401-sort-of-php/#findComment-120747 Share on other sites More sharing options...
jaymc Posted November 7, 2006 Author Share Posted November 7, 2006 Ah ha, now its working with the SESSION stuff takin outIs their anyway to sort it out so I can have the SESSION test working aswell Quote Link to comment https://forums.phpfreaks.com/topic/26401-sort-of-php/#findComment-120749 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.