Last active
January 21, 2022 21:27
-
-
Save le717/39abf54581302440a011286cb75d71b6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function makeSQLsafe($sql_input) { | |
$sql_input = str_replace("'","\\'",stripslashes($sql_input)); | |
$sql_input = str_replace('"','\\"',$sql_input); | |
$sql_input = str_replace(';','\\;',$sql_input); | |
//$sql_input = str_replace('%','\\%',$sql_input); | |
//$sql_input = str_replace('_','\\_',$sql_input); | |
$sql_input = str_replace("&","&\\;",$sql_input); | |
$sql_input = str_replace("<","<\\;",$sql_input); | |
$sql_input = str_replace(">",">\\;",$sql_input); | |
return $sql_input; | |
} | |
function makeSQLsafe($sql_input) { | |
$sql_input = str_replace("'","",stripslashes($sql_input)); | |
$sql_input = str_replace("&","&",$sql_input); | |
$sql_input = str_replace("<","<",$sql_input); | |
$sql_input = str_replace(">",">",$sql_input); | |
$sql_input = str_replace("`","",$sql_input); | |
/*$sql_input = str_replace("�","Æ",$sql_input); | |
$sql_input = str_replace("�","é",$sql_input);*/ | |
return $sql_input; | |
} | |
function makeSQLsafe($sql_input) { | |
$sql_input = mysql_real_escape_string($sql_input); | |
#$sql_input = str_replace("'","\\'",stripslashes($sql_input)); | |
#$sql_input = str_replace('"','\\"',$sql_input); | |
#$sql_input = str_replace(';','\\;',$sql_input); | |
//$sql_input = str_replace('%','\\%',$sql_input); | |
//$sql_input = str_replace('_','\\_',$sql_input); | |
#$sql_input = str_replace("&","&\\;",$sql_input); | |
#$sql_input = str_replace("<","<\\;",$sql_input); | |
#$sql_input = str_replace(">",">\\;",$sql_input); | |
return $sql_input; | |
} | |
function makeSQLsafe($sql_input) { | |
$sql_input = mysql_real_escape_string($sql_input); | |
return $sql_input; | |
} | |
function makeSQLsafe($sql_input) { | |
$sql_input = str_replace("'","\\'",stripslashes($sql_input)); | |
$sql_input = str_replace('"','\\"',$sql_input); | |
$sql_input = str_replace(';','\\;',$sql_input); | |
$sql_input = str_replace('%','\\%',$sql_input); | |
$sql_input = str_replace('_','\\_',$sql_input); | |
$sql_input = str_replace("&","&\\;",$sql_input); | |
$sql_input = str_replace("<","<\\;",$sql_input); | |
$sql_input = str_replace(">",">\\;",$sql_input); | |
return $sql_input; | |
} | |
function makeSQLsafe($sql_input) | |
{ | |
$sql_input = str_replace("'", "", stripslashes($sql_input)); | |
$sql_input = str_replace("&", "&", $sql_input); | |
$sql_input = str_replace("<", "<", $sql_input); | |
$sql_input = str_replace(">", ">", $sql_input); | |
$sql_input = str_replace("`", "", $sql_input); | |
$sql_input = str_replace("�", "Æ", $sql_input); | |
$sql_input = str_replace("�", "é", $sql_input); | |
return $sql_input; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment