How do we validate URL either with PHP/javascript? could u help me?for example,
whether input text is in the format http://www.google.com or not?
fernandodonster
0
Newbie Poster
Recommended Answers
Jump to Postif (!preg_match("#^http://www\.[a-z0-9-_.]+\.[a-z]{2,4}$#i",$url)) { echo "wrong url"; } else { echo "ok"; }
Jump to Postif (!preg_match("#^http://www\.[a-z0-9-_.]+\.[a-z]{2,4}$#i",$url)) { echo "wrong url"; } else { echo "ok"; }
that looks good, except that only letters, numbers, and hypens are allowed in a domain name (underscores are not allowed), and due to ICANN limitation domain names are limited to 64 characters. …
All 6 Replies
php_daemon
3
Junior Poster
paradox814
1
Posting Whiz
php_daemon
3
Junior Poster
ym_chaitu
0
Newbie Poster
Somnathpawar
5
Newbie Poster
prof php
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.