Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function sql_sanitize( $sCode ) {
- // If PHP version > 4.3.0
- if ( function_exists( "mysql_real_escape_string" ) ) {
- // Escape the MySQL string.
- $sCode = mysql_real_escape_string( $sCode );
- // If PHP version < 4.3.0
- } else {
- // Precede sensitive characters with a backslash \
- $sCode = addslashes( $sCode );
- }
- // Return the sanitized code
- return $sCode;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment