Page 1 of 1
URL question :/
Posted: Sat Aug 17, 2002 1:33 pm
by qads
how would i turn a url e.g.
http://www.somesite.com in to click-ble link?
btw, i am useing a text box whoes value is inseted into mysql db when submitted..
thanks for your time and help...
Posted: Sat Aug 17, 2002 2:23 pm
by gotDNS
I think i could help if i understood what u were asking.....what do u mean
A tag? lol.
If u mean that is getting iserted into a DB through a textbox, just make sure u allow the A tag and...yeah...
That probably, in no way, answers ur question..cuz i don't understand it.....what did u mean?
Posted: Sat Aug 17, 2002 2:24 pm
by gotDNS
OK, i think I might get it.....in a TEXTAREA this is going? If so...you could somehow STRSTR for lie.."www"....eh..i dunno
Posted: Sat Aug 17, 2002 3:44 pm
by hob_goblin
Code: Select all
function parseurls($data){
$data = " ".$data;
$data = eregi_replace('(її:space:]()ї{}])(www.ї-a-zA-Z0-9@:%_\+.~#?&//=]+)',
'\\1<a href="http://\\2" target="_blank">\\2</a>', $data);
$data = eregi_replace('(її:space:]()ї{}])(http://ї-a-zA-Z0-9@:%_\+.~#?&//=]+)',
'\\1<a href="\\2" target="_blank">\\2</a>', $data);
return trim($data);
}
if a url is in $data, it will be changed to a link
Posted: Sat Aug 17, 2002 5:10 pm
by gotDNS
....right...u take it hob_goblin...lol
Posted: Sat Aug 17, 2002 5:23 pm
by qads
lol, sorry guys, i was in a hurry, i did't even read it after posting

but thanks...