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 2 of 2
  1. #1
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts

    HTML::Entities; Resolved

    Hi,

    I am storing the usual type of form data supplied from a textarea. It may include French characters such as é which are to be allowed into the db.

    When I use the following code, however, the é is being changed to &ampeacute; so that it is being stored that way in the db. then when I recall it to display it on a page, it shows on the screen as é because the & is there.

    the regex I have tried isn't fixing the issue so I wonder if there is a straightforward error that I am overlooking.

    surely this is a bit clunky?

    Code:
    $description = $vars{'description'};
    
    $description = encode_entities($description);
    $description =~ s/&/&/g;
    it would help if I was editing the same script as the one I was looking at My 'problem' doesn't actually exist.

    bazz
    Last edited by bazz; 09-30-2010 at 03:15 PM.
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #2
    Regular Coder Stooshie's Avatar
    Join Date
    Mar 2008
    Location
    Dundee, Scotland
    Posts
    379
    Thanks
    9
    Thanked 39 Times in 39 Posts
    LOL! Common problem. I've done that before.
    Regards, Stooshie
    O


  •  

    Posting Permissions

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