Javascript & PHP for validating a URL is correctly entered and a resource exists