Jump to content

Sort of PHP...


jaymc

Recommended Posts

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 doesnt

Im 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 headache

Hope 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 it

Cheers!
Link to comment
https://forums.phpfreaks.com/topic/26401-sort-of-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.