Forum Moderators: coopster
1) When someone enters this inside a <textarea>:
Hi! this is some content</textarea> for my website!
@ It gets saved, but if i reload the form with that content, the "for my website!" tile gets lost out of the textarea.
2) Trying to implement a solution for the first problem, I inserted the strip_tags() function before saving the data, BUT the content must allow HTML because is a post for a news module.
I thought about using html_entity and html_entity_decode but i dont think that would solve the problem.
Any ideas?
function s($data,$html=false) {
if($html) {
$data = htmlspecialchars($data);
} else {
$data = strip_tags($data);
}
return $data;
}
That way i use the $html flag depending on the control:
1) Inputs: s($data)
2) Textareas: s($data,true)
Now i'm stuck with another problem. I can't use quotes in the inputs.
If I insert:
My name is "andres"
I get:
My name is \
What could be the solution for that?