Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.