Results 1 to 2 of 2

Thread: Forms converting character to HTML code

  1. #1
    Join Date
    Sep 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Forms converting character to HTML code

    Hello, I’m trying to do a php login system using a form on the main page and then a XML data store on the other side. I seem to be having problems when using some character within the text input box. The characters are £ or ‘. It automatically convert the character to a html code. So ‘ convert to \’ etc. So when it is place through the validation or straight into the xml it falls down…..

    The set up I am using, is an input text box on the form page, then I would use $_POST to retrieve the data from the form.

    I have tried using html_entity_decode() php internal function, but it doesn’t seem to do anything…..
    Has anyone else had this problem and if so how did they get around this?

    Thanks

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    It automatically convert the character to a html code. So ‘ convert to \’ etc.
    Eh? That's not an HTML entity. I'm not sure how this came to be, but you've got ‘ (an opening smart quote) being replaced with \’ (a backslash and closing smart quote). I'm going to assume that the smart quotes were meant to be apostrophes and say that you're experiencing magic_quotes_gpc, in which case you should call stripslashes() on the data, but I don't think magic_quotes_gpc would affect £ at all, so I'm a little lost there.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

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