i have this code
<?php
$song_id = (int) $this->uri->segment(3);
$query = $this->db->query('SELECT * FROM `artist_songs` WHERE `id`='.$song_id);
$song=$query->result();
$filename = 'artist/songs/'.$song[0]->path;
if(false !== ($fh = fopen($filename,'r'))){
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private", false);
header("Content-Type: audio/mpeg");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($filename));
readfile("$filename");
fclose($filename);
}
it was working before but now it does not. all it needs to do is to get a song and play it.
i know is getting the song because i did some test, so the problem is in one of the header, i do not understand headers yet. any help will be great. thanks.