Ver Mensaje Individual
  #6 (permalink)  
Antiguo 20/03/2009, 23:31
Avatar de jakoujan
jakoujan
 
Fecha de Ingreso: septiembre-2005
Ubicación: Mexico DF
Mensajes: 26
Antigüedad: 18 años, 7 meses
Puntos: 1
Respuesta: la bendita Ñ

mira yo lo que hago al momento de guardar la info en DB la substituyo y asi me evito de problemas

te paso el codiguito que uso es un truquillo pero me va muy bien y no tengo problemas

Código PHP:
<?
// Evitamos la inyeccion SQL

// Modificamos las variables pasadas por URL
foreach( $_GET as $variable => $valor ){
$_GET $variable ] = str_replace "'" "" $_GET $variable ]);
$_GET $variable ] = str_replace "\"" "" $_GET $variable ]);
}
// Modificamos las variables de formularios
foreach( $_POST as $variable => $valor ){
$_POST $variable ] = str_replace "'" "" $_POST $variable ]);
$_POST $variable ] = str_replace "\"" "" $_POST $variable ]);
$_POST $variable ] = str_replace "á" "&aacute;" $_POST $variable ]);
$_POST $variable ] = str_replace "é" "&eacute;" $_POST $variable ]);
$_POST $variable ] = str_replace "í" "&iacute;" $_POST $variable ]);
$_POST $variable ] = str_replace "ó" "&oacute;" $_POST $variable ]);
$_POST $variable ] = str_replace "ú" "&uacute;" $_POST $variable ]);
$_POST $variable ] = str_replace "Á" "&Aacute;" $_POST $variable ]);
$_POST $variable ] = str_replace "É" "&Eacute;" $_POST $variable ]);
$_POST $variable ] = str_replace "Í" "&Iacute;" $_POST $variable ]);
$_POST $variable ] = str_replace "Ó" "&Oacute;" $_POST $variable ]);
$_POST $variable ] = str_replace "Ú" "&Uacute;" $_POST $variable ]);
$_POST $variable ] = str_replace "ñ" "&ntilde;" $_POST $variable ]);
$_POST $variable ] = str_replace "Ñ" "&Ntilde;" $_POST $variable ]);
}
?>
Bueno de hecho uso el script para evitar inyeccion SQL y me va muy bien