Problem in one code... php.ini ?

i have one code in php, the code always worked on the old server, i new server not working! is possoble one problem in php.ini ?

the code is

<?php error_reporting(false); header('Content-type: audio/mpeg'); $audio=array( '1' => 'http://mysite/1.mp3', '2' => 'http://mysite/2.mp3', '3' => 'http://mysite/3.mp3', '4' => 'http://mysite/4.mp3' ); readfile ($audio[$_GET['porta']]); ?>

You may need to flush the object and and stream before sending out the data in the file.
Here is a link to the read command with examples how to flush the stream. Not sure if this
will solve it, but, give it a try.

http://www.php.net/manual/en/function.readfile.php

Also, are you just trying to play the MP3 in the background or force a download of the file?

If just playing it, you can place the filename into a Java Script that plays in HTML5 like this:

var snd = new Audio(“http://mysite/1.mp3”); // buffers automatically when created
snd.play();

Or something similar… Sending headers are tricky on some servers.

Sponsor our Newsletter | Privacy Policy | Terms of Service