Ver Mensaje Individual
  #4 (permalink)  
Antiguo 16/12/2011, 17:07
Avatar de leo_
leo_
 
Fecha de Ingreso: abril-2008
Mensajes: 40
Antigüedad: 16 años
Puntos: 11
Respuesta: Simbolo "&" se corta en POST php!

Hola yo lo haria algo asi:
Código PHP:
<form method="post" action="index.php">
<input type="text" name="text"></input>
<input type="submit"></input>
</form>
<?php
if (isset($_POST['text'])){
    
$text mysql_real_escape_string($_POST['text']);
    
$link mysql_connect('host','user','pass');
    
mysql_select_db('db',$link);
    
$sql "insert into test (id,contenido) values (null,'$text')";
                    
    
$resul mysql_query($sql);
    if (
$resul) {
        
$x mysql_insert_id();
        
$resul mysql_query("select * from test where id = $x");
        
$text mysql_fetch_assoc($resul);
        echo 
"<pre>";
        
print_r(htmlspecialchars($text['contenido']));
        echo 
"</pre>";
    } else {
        echo 
mysql_error();
    }
}
Igualmente por POST o por GET no tuve problemas puede ser q tu navegador no haga urlencode tipo
Código url:
Ver original
  1. index.php?text=<object+width%3D"426"+height%3D"350"+type%3D"application%2Fx-shockwave-flash"+data%3D"http%3A%2F%2Fwww.youtube.com%2Fv%2Fl1hF-VS1bGs%26feature%3Drelated"><param+name%3D"movie"+value%3D"http%3A%2F%2Fwww.youtube.com%2Fv%2Fl1hF-VS1bGs%26feature%3Drelated"+%2F><%2Fobject>+
es lo q se me ocurre q pueda pasar. Espero q te sea de ayuda. Saludos.

Última edición por leo_; 16/12/2011 a las 17:21