Welcome Guest, Not a member yet? Register   Sign In
how do i validate a url?
#1

[eluser]Shaheer[/eluser]
Hi,

i wanted to validate a url. Using PHP REGEX.

i have got some REGEXs by googling but all of them have flaws in them.

I wanted to match

all of these:
http://www.google.com
https://www.google.com
www.google.com
http://google.com
google.com/anything (or ?query )

but not javascript-: or mailto: can anyone help?

hey i am trying to type js protocol but expression-engine (the cms used here) removes it Big Grin
#2

[eluser]Shaheer[/eluser]
no reply Sad
#3

[eluser]sophistry[/eluser]
@shaheer... so, it looks like you waited 31 minutes to bump the thread - on a saturday. next time you might be more patient, especially with a problem that isn't directly CI related.

this page of this thread might help you parse URLs. let us know how it works out as this code should be in the auto_link function which would obviate your problem.

cheers.




Theme © iAndrew 2016 - Forum software by © MyBB