Bu kodu temiz kod veritabanına alır sağlamak gerekiyordu
PHP önceki sürümlerinde çalışmak gerekiyordu php (4.3.0 daha erken) ve sonraki sürümleri (4.3.0 daha eski)
veri bir sorun olmadan veritabanına alır ama tarayıcı üzerinde bir hata olsun çünkü iyi çalışıyor
$menu_name = mysql_prep($_POST['menu_name']);
i mysql_prep işlevini çağırmak nasıl
function mysql_prep($value)
{
$get_magic_quotes = get_magic_quotes_gpc();
$new_enough_php = function_exists ("mysql_real_escape_string"); //check if php version is greater than 4.3.0
if($new_enough_php) // if php is of a newer version
{
//undo magic quotes effect so that mysql_real_escape_string can work well
if ($get_magic_quotes)
{
$value = stripslashes ($value);
}
$value = mysql_real_escape_string($value);
}
else //mysql is older than 4.3.0
{
//add slashes manually if magic quotes are off
if(!$get_magic_quotes)
{
$value = addslashes ($value);
}
//if magic quotes already exist, slashes already exists
}
return $value;
//$value = mysql_real_escape_string($value);
//$value_without_slashes = stripslashes ($value);
//return $value_without_slashes;
}