I'm looking for a way for visiters to be able to add an url of their website in a guestbook I've created, but I can't find any reference on how to get this to work in a way that the url is automaticly parsed in the guestbook.
I've probably not looked hard enough in this forum, but please help me.
Just add the tags around their input.
echo "<a href=\"".$theirsite."\">".$theirsite."</a>";
Or, if you want it done automatically, just use a regex:
$str = preg_replace("/((?:http|ftp)s?:\\/\\/[-a-z0-9]+(?:\\.[-a-z0-9]+)+(?:[-\\w:@&?=+,.!\\/~*'%#$]*(?<![.,?!]))?)/i", "<a href=\"$1\">$1</a>", $str);
Thanks guys, that's just what I was looking for.