lewisstevens1 Posted June 15, 2013 Share Posted June 15, 2013 Hi i was just wondering how you would create something like Google's webmaster Tools website validation (where you download a file, upload to the url then validate it). I was looking at oAuth but i wasn't sure how to build it into the script - how does it get / generate the authentication token / key?. Would be great if someone could help. Many thanks Lewis Stevens Quote Link to comment Share on other sites More sharing options...
Q695 Posted June 15, 2013 Share Posted June 15, 2013 the file being uploaded is passed as a $_FILE, similar to how an image is handled. Quote Link to comment Share on other sites More sharing options...
kicken Posted June 15, 2013 Share Posted June 15, 2013 (edited) If you're talking about how google has you upload a file of a specific name to your website in order to validate your ownership, then that is relatively easy. a) You generate a unique token and use it as part of the file name. uniqid can generate the token, md5 or sha1 can be used to hash it, making it more user friendly. You could use any other method you want too. B) Tell the end user what the token is and what to do, ie 'Create a file named "verify_XXXXX.html" in the root' where XXXXX is the token. c) Have your server make a http request to their site for the file. curl can be used to make this easy. If the file exists then consider them validated. Edited June 15, 2013 by kicken Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.