Right now it seems that users can submit *anything* as an URL, e.g. http://asfwasrwee. How can I make sure/auto-check that only valid URLs are submitted? Thanks!
You can't. You can check reciprocal link urls for your link although it's dangerous to do so and can lead to tbe browser hanging doing nothing when the page doesn't exist, but not regular site urls. To do so would simply make attempted submissions take forever, or best case scenario would lead to URLs being rejected because they happen to be slow loading.
Actually I didn't mean checking if the site exists - just basic validation if it's valid URL syntax in the first place. Really nothing fancy, as far as I'm concerned it needn't even check for specific TLDs, but every URL should at least have a . and *some* kind of extension.
0/5
1
2
3
4
5
This thread is closed, so you cannot post a reply.
Comments on Valid URLs
Member
Usergroup: Customer
Joined: Jan 30, 2005
Total Topics: 5
Total Comments: 12
Right now it seems that users can submit *anything* as an URL, e.g. http://asfwasrwee. How can I make sure/auto-check that only valid URLs are submitted? Thanks!
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
You can't. You can check reciprocal link urls for your link although it's dangerous to do so and can lead to tbe browser hanging doing nothing when the page doesn't exist, but not regular site urls. To do so would simply make attempted submissions take forever, or best case scenario would lead to URLs being rejected because they happen to be slow loading.
Member
Usergroup: Customer
Joined: Jan 30, 2005
Total Topics: 5
Total Comments: 12
Actually I didn't mean checking if the site exists - just basic validation if it's valid URL syntax in the first place. Really nothing fancy, as far as I'm concerned it needn't even check for specific TLDs, but every URL should at least have a . and *some* kind of extension.