Log in

View Full Version : Forms converting character to HTML code



coops2000
10-08-2007, 08:20 AM
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

Twey
10-08-2007, 04:15 PM
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.