Link to home
Start Free TrialLog in
Avatar of rivkamak
rivkamakFlag for United States of America

asked on

php htmlentities

I am trying to put some php code on my page, and I am running into a problem with people filling out single quotes on their form
I tried putting this
htmlentities ($_POST['ReferenceNum2']) 

Open in new window

Why is it not replacing the single quotes properly?
ASKER CERTIFIED SOLUTION
Avatar of Marco Gasi
Marco Gasi
Flag of Spain image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What are you trying to do with the client input?  Different usage cases need different handling.  If you're putting it into a database, you escape the data.  If you're echoing it to the client browser you escape the data.  But (unfortunately) the meanings of "escape" are different in these cases.

Please tell us a little more and maybe we can give more specific recommendations.

If you're new to PHP this article may help you find some good learning resources.
https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html