davehardyuk Posted March 10, 2006 Share Posted March 10, 2006 Hi guys, i have this code:[code]print "<body marginheight=\"0\" marginwidth=\"0\" leftmargin=\"0\" rightmargin=\"0\"><object id=\"MediaPlayer\" width=\"360\" height=\"69\" classid=\"CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95\" type=\"application/x-oleobject\"><param name=\"FileName\" Value=\"$fileid\"><param name=\"ShowControls\" value=\"true\"><param name=\"ShowStatusBar\" value=\"true\"><param name=\"ShowStatusBar\" value=\"true\"><param name=\"ShowDisplay\" value=\"false\"><param name=\"autostart\" value=\"true\"><EMBED SRC=\"$fileid\" WIDTH=\"360\" HEIGHT=\"69\" AUTOSTART=\"FALSE\" TYPE=\"audio/mpeg\"></EMBED> </object>";[/code]Which pulls in a variable called $fileid.The problem is, sometimes the fileid has an apostrophe in the filename and it can't be played.Any ideas on how to get around it?Thanks,Dave Quote Link to comment Share on other sites More sharing options...
craygo Posted March 10, 2006 Share Posted March 10, 2006 Use the addslashes function. you can call it before$fileid2 = addslashes($fileid);then use $fileid2 in the echo<param name=\"FileName\" Value=\"$fileid2\">you can also callit right in the echo but this seems easierRay Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.