problem with readfile()

hello!

there is this SWF object, just a small mp3 player.


<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="550" height="20" id="FlashID" title="player">
	<param name="movie" value="player.swf" />
	<param name="FlashVars" value="configxml=player.xml&amp;mp3=soundfetcher.php?<? echo "fn=".$fileid."&con=".$control."&con1=".$referer; ?>" />
	<param name="quality" value="high" />
	<param name="wmode" value="transparent" />
	<param name="swfversion" value="7.0.70.0" />
	<param name="expressinstall" value="assets/expressInstall.swf" />
		<object type="application/x-shockwave-flash" data="player.swf" width="550" height="20">
		<param name="FlashVars" value="configxml=player	.xml&amp;mp3=soundfetcher.php?<? echo "fn=".$fileid."&con=".$control."&con1=".$referer; ?>" />
		<param name="quality" value="high" />
		<param name="wmode" value="transparent" />
		<param name="swfversion" value="7.0.70.0" />
		<param name="expressinstall" value="assets/expressInstall.swf" />
		<div><h4>Content on this page requires a newer version of Adobe Flash Player.</h4><p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p></div>
		</object>
	</object>

Open in new window



please take note that the MP3 file is not hard coded, but called from another php file.
essentially that php file "soundfetcher.php" contains some authentication codes and finally a readfile()

header('Content-type: audio/mpeg');
header('X-Pad: avoid browser bug');
header('Cache-Control: no-cache');

if ($okfinal==3) {readfile('something.mp3');};

Open in new window



this readfile() is just outputting the contents of the mp3 file into the code.
naturally, that doesn't work.

so my question is what command should i use to replace the readfile() so that the player works??

my knowledge of php is very limited, so if you are explaining someting, explain as if you were doing it to a 10 year old :)
also, if you need any more info that will help you solve this issue, please ask.


thanks,
hathehariken.
player.swf
player.xml
LVL 12
hatheharikenAsked:
Who is Participating?
 
Lukasz ChmielewskiConnect With a Mentor Commented:
What if you add this:

header('Content-Transfer-Encoding: binary');
in here:
header('Content-type: audio/mpeg');
header('X-Pad: avoid browser bug');
header('Cache-Control: no-cache');
0
 
Lukasz ChmielewskiCommented:
0
 
hatheharikenAuthor Commented:
it works!!!

header('Content-Transfer-Encoding: binary');
header('Content-type: audio/mpeg');
header('X-Pad: avoid browser bug');
header('Cache-Control: no-cache');

Open in new window


you are simply a genius!
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

 
Lukasz ChmielewskiCommented:
Happy listening.
0
 
hatheharikenAuthor Commented:
i do have one more small question, if you dont mind.
can you point me a place where there are lots of flash mp3 players to choose from?
0
 
Lukasz ChmielewskiCommented:
As it is not my area the only thing I can point you to is to google it :/
It would be rude to just paste the link to "mp3 flash player" or "freeware mp3 flash player" so, give it a go.
0
 
hatheharikenAuthor Commented:
:)

okay then!
thanx again...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.