lets say i have a url form box. well, obv some people are going to miss off the http:// bit, how can i add this so if [url]www.webdeveloper.com[/url] was the string it would go, [url]http://www.webdeveloper.com[/url].
however, if [url]http://www.webdeveloper.com[/url] was entered it would leave it as it is…
@pcthugAug 27.2006 — #[code=php] // where $url is the given URL if(substr($url, 0, 7) != 'http://') { $url = "http://$url"; }[/code]You may however want to add support for other protocols, i.e. ftp, https, etc.
@deep-woodauthorAug 27.2006 — #[code=php] // where $url is the given URL if(substr($url, 0, 7) != 'http://') { $url = "http://$url"; }[/code]You may however want to add support for other protocols, i.e. ftp, https, etc.[/QUOTE] ahh thankyou! ?