Magic quotes
Posted: Wed Jan 21, 2009 4:02 am
I have been using php 5 and use the following code for escaping input data :
function clean($str) {
$str = @trim($str);
if(get_magic_quotes_gpc()) {
$str = stripslashes($str);
}
return mysql_real_escape_string($str);
}
$cust_id = clean($_POST['cust_id']); //function call
magic_quotes_gpc/magic_quotes_runtime have been removed as of php 6.0.0. why so???what other coding techniques do u guys use??
thanks!!
function clean($str) {
$str = @trim($str);
if(get_magic_quotes_gpc()) {
$str = stripslashes($str);
}
return mysql_real_escape_string($str);
}
$cust_id = clean($_POST['cust_id']); //function call
magic_quotes_gpc/magic_quotes_runtime have been removed as of php 6.0.0. why so???what other coding techniques do u guys use??
thanks!!