I'm thinking of hosting a name that tune type game.
I don't know anything about PHP or even if it's the languge to use, but I'm hoping someone
might put me straight on that matter too.
Here is an outline of my needs/scenario.
I post a link to a song.mp3 I have uploaded to my host, the user has to guess the song and artist.
The problem is, as I'm sure most here will have immediately envisioned is the link to the song title
will be visible to anyone with some knowledge of how this sort of thing works.
I could change the title and meta data of the file, but that seems overkill.
I want to make a link to say Guess.mp3, but when that link is clicked it serves up an entirely different
Song.mp3 which is determined by a php script which cannot be seen or found without a fair bit of jiggery pokery.
I hope you follow what I mean and can advise if such a thing is even possible.
My hopes are that the link can be posted not on my own website, but for instance here at daniweb.
Any advice or suggestions of other methods are very welcome and much appreciated.
What it's trying to say with "No output before the header" is there should be data to be output in the stream befor ethe header. When the HTML tag was included above, and before the '<?php' it already send a set of character to the output stream, which is the "<html>".
So the reason behind this is when you send the out put using the HTTP protocol(not in the context of PHP) it would look like this:
... other http fields ...
Which means, if read by the reciever is a malformed HTTP. Another way of expressing the sample in the PHP Manual is this:
/* This will give an error. Note the output
* above, which is before the header() call */
So what you did earlier is right. You have to put the length especially if it's a get request, so the reciever, which is the browser would know when to stop listening for incoming data.
Anyhow, here's the sample code from SO, using your code:
Yes, and plays fine with all meta data in tact.
I really do appreciate the time you have put into your generous assistance.
I'm beginning to think I might as well just remove meta data, and rename files, just seems too much.