Jump to content

Forms converting character to HTML code


coops

Recommended Posts

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

 

Link to comment
https://forums.phpfreaks.com/topic/72279-forms-converting-character-to-html-code/
Share on other sites

Instead of using html_enitity_decode() try html_entities.

 

I say this because you have a character example '&'.  Your code tells the the form to put a & inside.  But the form outputs a &.  It is slightly annoying.  But what the form needs to see so it executes correctly is &.  The logic of that will make much more since when you see it in the form.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.