...

View Full Version : Embed code in mysql



graham23s
03-20-2010, 10:17 PM
Hi Guys,

When i insert video embed code into mysql for example:



<object width="640" height="270"><param name="movie" value=""></param><param name="allowFullScreen" value="true"></param><embed src="" type="application/x-shockwave-flash" allowfullscreen="true" width="640" height="270"></embed></object>


all the <> symbols appear as &^54 (or similar) what would be the proper way to deal with this? do i need to do anything to the embed code before it goes in or when it comes out?

thanks fior nay help guys

Graham

_Aerospace_Eng_
03-20-2010, 10:22 PM
No when you echo it back out from the db it will appear just as you entered it. I would probably use mysql_real_escape_string on it first.

MattF
03-20-2010, 10:29 PM
If you're referring to &# 62; etc, (without the space), the HTML code is being entity encoded. Checked what's in the DB to see if it's being encoded on input or output.

graham23s
03-21-2010, 02:23 PM
Hi Guys,

i checked in the database and its being encoded on input, is this because i'm using tinymce do you think?

cheers guys

Graham

MattF
03-21-2010, 02:46 PM
i checked in the database and its being encoded on input, is this because i'm using tinymce do you think?

Most likely so. See if there's an option within it to disable entity encoding.

JAY6390
03-21-2010, 03:15 PM
Just decode the special characters

http://www.php.net/manual/en/function.htmlspecialchars-decode.php

graham23s
03-21-2010, 09:20 PM
thanks for the help guys i got it sorted :)

cheers

Graham

MattF
03-21-2010, 09:32 PM
thanks for the help guys i got it sorted :)

Good to hear. It would help if you mentioned how you've sorted it, btw. The answer will then be archived for reference if anyone runs across the same problem in the future.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum