Im looking for a regex to make sure noboy haxes in stuff I dont want in a guesbook I made in PHP. Such as, scripts, sqlinjections, html etc. But still I want the users to be able to use as many chars as they can (ex :)(/?!.,”&-_) without doing the site less safe.
ideas of how that regex would look like?
Note that
htmlspecialcharshelps prevent XSS, not SQL injection. To prevent SQL injection, use prepared statements. To prevent CRSF, you can do a little research.