Ver Mensaje Individual
  #13 (permalink)  
Antiguo 11/04/2012, 08:31
Avatar de Jemonge
Jemonge
 
Fecha de Ingreso: enero-2011
Mensajes: 28
Antigüedad: 13 años, 3 meses
Puntos: 0
Pregunta Respuesta: Problema al procesar string

Cita:
Iniciado por elarrieux Ver Mensaje
Probalo asi, a mi me funciono:

Index.html

Código PHP:
<!DOCTYPE html>
 
<
html lang="es">
    <
head>
<
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
        <
script src="http://code.jquery.com/jquery-1.7.2.min.js" type="text/javascript"></script>
        <script type="text/javascript" src="acciones.js"></script>
    </head>
 
    <body style="text-align: center;">
        <div style="text-align: left; width: 500px; margin: 0 auto;">
            <form action="" method="post" name="postedit">
                <div style="float:left; color:#0D7200; font-weight: bold; margin-bottom:3px;">
                    <div style="display:inline-block; margin-left:5px;">
                        Categoria:
                    </div>
                    <div style="display:inline-block; margin-left:5px;">
                        <input id="EditCategoria" class="inputPublicar" style="height: 20px; margin-left: -5px;" type="text" maxlength="25" value="Música">
                    </div>
                </div>
                <div id="focusEditar">
                    <input class="login" type="submit" style="float:right;" name="postEdit" id="postEdit" value="Guardar" onclick="return Guardar(this.form.EditCategoria.value);" tabindex="2">
                </div>
            </form>
        </div>
    </body>
</html> 
acciones.js

Sin cambios

guardar.php

Código PHP:
<?php
 
        $categoria 
$_POST['categoria'];
        
//Limpiar 
        //$categoria = preg_replace("/[^a-z ñáéíóú]/i", "", $categoria); 
        
        
echo $categoria." *";
?>
Sds.
Gracias por responder elarrieux

Si ejecuto el código que colocaste en efecto me mantienen las tildes

... el problema es que no me elimina los caracteres que no quiero, por ejemplo si escribo "Música>" debería devolver "Música" pero vuelve a devolver "Música>"

Gracias de nuevo...