Ver Mensaje Individual
  #3 (permalink)  
Antiguo 08/04/2009, 18:33
Avatar de hgp147
hgp147
 
Fecha de Ingreso: diciembre-2006
Ubicación: Buenos Aires, Argentina
Mensajes: 980
Antigüedad: 17 años, 4 meses
Puntos: 36
Respuesta: Problema codificación símbolo euro (€)

Hola Ronruby, gracias por responder dejo algunos screenshoot y códigos:











Archivo donde ingreso el titulo:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
<head>

<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />

</head>
<body>

<form name="form" action="procesa_agregar_anuncio.php" method="post" target="iframeForm">

<label for="titulo">Titulo</label>
<input type="text" name="titulo" id="titulo" size="50" />

...


Archivo que agrega el titulo a la base de datos:

<?

$titulo = $_POST['titulo'];


mysql_query("UPDATE anuncios SET
titulo = ".mysql_escape($titulo).",

...




La función mysql_escape:



function mysql_escape($val) {

$val = utf8_decode(trim($val));

if (get_magic_quotes_gpc()) $val = stripslashes($val);

$f = (function_exists('mysql_real_escape_string')) ? "mysql_real_escape_string" : ((function_exists('mysql_escape_string')) ? "mysql_escape_string" : "addslashes");

return (!is_numeric($val)) ? "'".$f($val)."'" : $val;

}



Archivo donde muestro el titulo:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
<head>

<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />

</head>
<body>

<?

$titulo = htmlentities($row2['titulo']);

echo $titulo;

...
__________________
Spread Firefox | Download Day 2008
¡Únete en nuestra misión para alcanzar el Record Guinness al software más descargado en 24 horas! http://www.spreadfirefox.com/es-ES/worldrecord/