database INSERT and UPDATE converts symbols to html code |
I believe its browser security to avoid breaking forms, the characters are escaped. For example, cant do <textarea><p></p></textarea>. The p tags have to be escaped before displaying the form. I've had some success with the following although I wish a security expert can shed some light about this practice:
The first code is in the controller and the second code is in the view file (html): Code: $data['entry_content'] = htmlspecialchars_decode($entry[0]['content']); Code: $parameters1 = array(
You're not supposed to decode something you've just encoded yourself, just don't encode in the first place. set_value() allows that, look at the link I gave in my last post.
Thank you, Narf! I didn't have that third parameter of set_value set to FALSE. Problem solved for the edit registration form, where the values are coming from the database.
PHP Code: 'value' => set_value('last_name', $client->last_name, FALSE) But in the original form, after the form validation error messages are posted, and I have the form inputs retaining state using this code PHP Code: $attributes = array( I tried PHP Code: 'value' => set_value('last_name', NULL, FALSE) (03-11-2016, 11:59 AM)Narf Wrote: You're not supposed to decode something you've just encoded yourself, just don't encode in the first place. set_value() allows that, look at the link I gave in my last post. Done, but when I edit a post, the < lessthan sign is escaped in the form input and the HTML source doesnt show the quotes/single quotes as escaped. |
Welcome Guest, Not a member yet? Register Sign In |