X

We would like to inform you that the domain chat-to.dev, as well as the associated project, is available for purchase. Those interested in negotiating or obtaining more information can contact us at contact@chat-to.dev.

We would like to thank everyone who has followed and supported the project so far.

1702208017

Sanitize fields


When accepting user input for redisplay, and particularly if it will be inserted into a database, it’s important that you sanitize the input to remove any malicious attempts at hijacking your server, or otherwise injecting unwanted MySQL commands, HTML, or JavaScript. ## the function ```php function SanitizeString($string){ $string = strip_tags($string); return htmlentities($string); } function MysqlSanitizeString($string){ if(get_magic_quotes_gpc()) $string = stripslashes($string); $string = SanitizeString($string); return mysql_real_escape_string($string); } ``` ### About the Recipes These recipes take a string and sanitize it for reuse on your web site and/or in a MySQL database. They require this argument: >  **$string**   A string to be sanitized.

(1) Comments
amargo85
amargo85
1738850382

mach simple code, implement more if you can


Welcome to Chat-to.dev, a space for both novice and experienced programmers to chat about programming and share code in their posts.

About | Privacy | Donate
[2026 © Chat-to.dev]