Tema: mostrar link
Ver Mensaje Individual
  #4 (permalink)  
Antiguo 30/01/2007, 18:10
okram
Invitado
 
Mensajes: n/a
Puntos:
Re: mostrar link

Cita:
Iniciado por pereztroff Ver Mensaje
gracias, era la solución perfecta
Se me ocurre algo para mejorar esa cosa q t envie....

Código PHP:
$txt $_POST['campo_del_formu']; 
 
//DIRECCIONES DE TIPO http://algo.com, http://www.algo.com, ftp://algo.com, https://algo.com
$txt ereg_replace("(ftp|http|https)://(([.]?[a-zA-Z0-9_/-\?&])*)"" <a 
href=\"\\1://\\2\" target='_new' nofollow>\\1://\\2</a>"
$txt); 

//DIRECCIONES DE TIPO www.algo.com
$txt ereg_replace("[^(http://)](www.([.]?[a-zA-Z0-9_/-\?&])*)"" <a 
href=\"http://\\1\" target='_new' nofollow>http://\\1</a>"
$txt); 
Esto puede serte util, ya que nunca sabes como un usuario va a escribir su url (http://www.google.com | www.google.com | http://google.com)

Salu2