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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.