PHP is server side and all Googlebot would see is the output HTML, right?
if (strpos($_SERVER[‘HTTP_USER_AGENT’],"Googlebot")) { // do some functionality }
Webmasters Stack Exchange is a question and answer site for pro webmasters. It only takes a minute to sign up.
Sign up to join this communityPHP is server side and all Googlebot would see is the output HTML, right?
if (strpos($_SERVER[‘HTTP_USER_AGENT’],"Googlebot")) { // do some functionality }
Defeating this is easy and has nothing to do with doing this on the server side. All they have to do is compare a page that you serve to the Googlebot user agent and one to a bot or human that is not. The pages will be different and you will be caught and penalized for cloaking. It's that simple.