...

View Full Version : Write out current time PHP script



serendipity
05-31-2004, 08:27 PM
:confused:

Ok, first off, I must apologize...i have absolutely no idea where to begin here...i don't even know what to ask...so here's what I wanted to do and was trying to do...

I wanted to show the "my webserver's actual time and date" on my webpage instead of showing the visitors' time and date which is what is usually done in most pages (like duh,...they already know that :rolleyes: ) Anyhoo, so I found this script on this page:

http://www.shearersoftware.com/software/web-tools/clock/

which is exactly what I had wanted (it would have been more cool if it was running the seconds off...) However, it was not as simple and easy as it seemed on the instructions: Copy & paste to text editor, re-position divs etc. Save as .PHP (uh-oh!) and upload to server...I know i'm missing something...BIG here...so what is it?? :confused: Coz it's not showing up the way I think it should unlike javascript or anything...not even close :(

Thanks for any tips...do i need to install something???

NewbieMe

gsnedders
05-31-2004, 08:45 PM
How is it showing up?

firepages
06-01-2004, 05:38 AM
does your server have PHP installed ?

Len Whistler
06-01-2004, 05:50 AM
If your site is set up with php the code below will display the year the server is set to. Check out a php book or the php manual for more time/date combonations.


<?php

echo date('Y');

?>

Leonard Whistler
www.stubby.ca

litebearer
06-01-2004, 06:23 AM
Bear in mind that php is sever side so the time will not increment automatically without a page refresh. To have it continuously change you need to use javascript (client side)

Len Whistler
06-01-2004, 06:32 AM
Good point litebearer

Instead of displaying the server time, which in my opinion is just as useless as displaying the user-computers time, I think it would be neat to be able to tap into the Atomic Clock and display the exact time of the earth.

Leonard Whistler
www.stubby.ca

serendipity
06-02-2004, 01:17 AM
does your server have PHP installed ?

How would you know...if it has PHP installed? (aside from asking the guys that run it...)


How is it showing up?

When I uploaded the php script as instructed...and when I opened the webpage, it just automatically prompted a Save It As box....it doesn't show up actually...

firepages
06-02-2004, 02:27 AM
it just automatically prompted a Save It As box....

which almost certainly means you do not have PHP available on the server , to be 100% sure though you need to ask, as you may have PHP as a CGI available or via some other extension rather than .php.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum