Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder
    Join Date
    Jul 2007
    Location
    Scotland
    Posts
    134
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Embed code in mysql

    Hi Guys,

    When i insert video embed code into mysql for example:

    Code:
    <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

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    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.

  • #4
    Regular Coder
    Join Date
    Jul 2007
    Location
    Scotland
    Posts
    134
    Thanks
    12
    Thanked 0 Times in 0 Posts
    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

  • #5
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    Quote Originally Posted by graham23s View Post
    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.

  • #6
    Regular Coder
    Join Date
    Dec 2009
    Location
    UK
    Posts
    495
    Thanks
    0
    Thanked 58 Times in 58 Posts
    Just decode the special characters

    http://www.php.net/manual/en/functio...ars-decode.php
    My site: JayGilford.com
    Resources:
    PHP Pagination Class | Getting all page links | Handling PHP Errors properly
    If you like a users help, show your appreciation with the rep and thanks buttons :)

  • #7
    Regular Coder
    Join Date
    Jul 2007
    Location
    Scotland
    Posts
    134
    Thanks
    12
    Thanked 0 Times in 0 Posts
    thanks for the help guys i got it sorted

    cheers

    Graham

  • #8
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    Quote Originally Posted by graham23s View Post
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •