How do I use esc() in html form input AND get readable text? |
03-25-2024, 06:22 PM
(This post was last modified: 03-25-2024, 06:49 PM by objecttothis. Edit Reason: clarity )
Problem:
This code PHP Code: <?php $sample_text = 'The quick brown fox!'; Yields a textbox with the value "The quick brown fox!" How can I escape output but still produce readable text in the form? I want "The quick brown fox!" and simple sentences to be plaintext but everything else to be escaped. Is 'attr' the correct context to use here?
The value of "value" is automatically escaped by form_input().
PHP Code: 'value' => $sample_text
|
Welcome Guest, Not a member yet? Register Sign In |