Ver Mensaje Individual
  #8 (permalink)  
Antiguo 02/06/2014, 12:07
Avatar de Italico76
Italico76
 
Fecha de Ingreso: abril-2007
Mensajes: 3.303
Antigüedad: 17 años, 11 meses
Puntos: 292
Respuesta: Caracteres ">" y "<" en url generan un "Forbidden"

Te toco escribir el decode() pero al menos asi funciona:

Código PHP:
Ver original
  1. <?php
  2.  
  3. function my_htmlentities($s){
  4.     return str_replace(array('<','>','\\','/'),array('__menor__','__mayor__','__slash__','__diagonal__'),$s);
  5. }
  6.  
  7. $foo = 'bla bla <b>Hello World!</b>';
  8. $foo_encoded = urlencode(htmlentities(my_htmlentities($foo)));
  9.  
  10. var_dump($foo_encoded);
  11. ?>
  12. <a href="<?= 'http://localhost/pruebas/test-'.$foo_encoded; ?>">Enlace</a>
__________________
Salu2!