Forum Moderators: coopster
does anybody knows how to validate inputted url by the user? it should check if the url has http, www and com, that if the user will just input http://example.com it will echo invalid url and if the user will input [example...] with out the .com it will also notify the user that he/she has inputted the invalid url...
actually im using this url checking if(!preg_match('¦^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$¦i',$url))
but it will only check for the http and not with www and com... please help me..tnx
[edited by: dreamcatcher at 7:59 am (utc) on Feb. 26, 2008]
[edit reason] Use example.com, thanks. [/edit]