0

I've got a function for making input safe. One takes from a textarea on a form.
The problem is when someone types a few paragraphs in it, using regular sentence stuff like ( ' , . () ? ) it kicks it out and gives them my error message.
How can I keep out the unsafe stuff, but still allow someone to "speak their mind"? Something like a preg_replace maybe?
If so, how can I add it on to my other function?
Thanks
Dan

3
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by matthewl
0

It seems that everything works perfectly except for the stripslashes won't accept apostrophes.
How do I fix this?

0

can you give give me an example of the code/data and/or php error if there is one?

Edited by matthewl: n/a

0
<?php 
$str = "Is your name O\'reilly?"; 
  
// Outputs: Is your name O'reilly? 
echo stripslashes($str); 
?>

Thank you. Why did I not think of posting that example? Oh well.

Edited by matthewl: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.