Check If URL Is Valid
coiin at verizon.net
Sun Aug 8 12:37:57 EDT 2010
On Aug 8, 2010, at 12:19 PM, Warren Kuhl wrote:
> I need to check if a URL is valid and receive notification for invalid
> URLs. I don't want my program to open any browswers when checking. Is
> this possible?
In some cases it is. If the page you try to access doesn't exist, but the server traps for that, then it's harder to tell. Try these in the message box to see the difference:
put url "http://www.runrev.com/" contains "404 Not Found"
put url "http://www.runrevvvvvv.com/" contains "404 Not Found"
put url "http://www.runrev.com/abcdefg.html" contains "404 Not Found"
The first and third ones show "false", and the middle one "true". Although the third one returns false, the page doesn't really exist, but runrev.com handles that and redirects you to another page.
More information about the Use-livecode