Jump to content

Print and apostrophe problem


davehardyuk

Recommended Posts

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
Link to comment
Share on other sites

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 easier

Ray



Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.