Get exclusive CAP network offers from top brands

View CAP Offers

Reply To: Time and date code

[bsa_pro_ad_space id=2]
#812279
Anonymous
Inactive

I believe Bots only read raw code so client side languages like javascript and html won’t work as its the browser that actually executes it.

This worked on my GoDaddy Linux server but I know they configured it to parse server side includes (ssi).

I created a php file called stamp.php with chip’s php code below, nothing else. (upload it of course but I’d disallow it from getting crawled in the robots.txt file)

print date(“F j, Y, g:i a”);
?>

I made an html test page called test-stamp.html







date from included stamp.php



Inside my test page I added a single line of code to include stamp.php.
Add the line of code below in your html pages where you want the date/time stamp to display:

I uploaded the test page (stamp-test.html) to my server and fetched it via Google Webmaster tools. Below is exactly how Googlebot sees it. I added a line of html

date from included stamp.php

to show that Google reads raw html. First Google got the header info but after that you can see where the test HTML page starts. In bold you can see where the server delivered the output of stamp.php and not the code itself as it does with HTML and Javascript.

This is how Googlebot fetched the page.

URL: xhttp://www.slottipsguide.com//stamp-test.html

Date: Sat Sep 18 18:57:50 PDT 2010

Googlebot Type: Web

HTTP/1.1 200 OK
Date: Sun, 19 Sep 2010 01:57:50 GMT
Server: Apache
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html






date from included stamp.php

September 18, 2010, 6:57 pm