- This topic is empty.
-
AuthorPosts
-
September 16, 2010 at 7:29 pm #622753winner.comMember
Any one have a time and date code that google (et all) can read the date?
thanks
September 16, 2010 at 8:53 pm #812230AnonymousInactiveyou mean just print time?
php and asp have an easy call for that for server time
September 16, 2010 at 9:18 pm #812231winner.comMemberI mean when people come to a web page and see the date and time
but at the same time google will index the date
September 17, 2010 at 1:25 pm #812258AnonymousInactiveyou can add this
[PHP] print date(“F j, Y, g:i a”);
?>[/PHP]will make a format like this. March 10, 2001, 5:16 pm
for more information check PHP: date – Manual
September 17, 2010 at 2:43 pm #812262winner.comMemberThanks for your help but I was looking for html code ( I guess I should have said that)
September 18, 2010 at 3:39 am #812264AnonymousInactivewell, what server do you use? adding that line in a html page will give you the output if your on php (linux)
September 18, 2010 at 6:16 pm #812274AnonymousInactive@allfreechips 222363 wrote:
well, what server do you use? adding that line in a html page will give you the output if your on php (linux)
Hi. Actually no, to add php code, the file must be .php
for .html there is only JavaScript solution, but I think Google don’t indexing JS.
September 19, 2010 at 1:12 am #812278AnonymousInactivewell, true you got me ther lol, i use php to process html pages as well, but then were getting deep. as for a true html solution i cant think of any as you can not script it, and java of course wont be proccesed by a se.
If you want to get deeper we can have php parse html pages, and then have the ability to add php code in the .html
September 19, 2010 at 2:46 am #812279AnonymousInactiveI 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.phpto 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.phpSeptember 18, 2010, 6:57 pm
September 20, 2010 at 6:12 pm #812312AnonymousInactiveslotplayer: Server Side Includes (SSI) – great solution!!! (I totally forgot about it :banger:).
And I think this method is good for many useful things
Thanks!
-
AuthorPosts