Edit value on db with ' or " |
hi , sorry for english , if i want t a value inserted by textarea i have problem with ' .
This is the code : Code: <input class='form-control' type='text' value='<?=$val?>' id='id_class_descrizione_problema' name='descrizione_problema' maxlength='65535' > $val is a value from db . How can i prevent error textwith ' or " or \ ?
PHP.NET - htmlspecialchars
PHP.NET - htmlentities What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
This is not the right html code for a textarea. What you should do is this:
PHP Code: <textarea name="descrizione_problema" id="id_class_descrizione_problema" class="form-control" rows="12" maxlength="65535">
Use the esc() helper function:
PHP Code: <input type="text" name="myfield" value="<?= esc($string); ?>" />
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
@includebeer, that's a CI 4 method. You can use html_escape(value), or form_prep().
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(08-05-2019, 07:56 AM)InsiteFX Wrote: @includebeer, that's a CI 4 method. You can use html_escape(value), or form_prep(). Yeah, but people should really develop new projects with CI4!
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/ |
Welcome Guest, Not a member yet? Register Sign In |