Link to home
Start Free TrialLog in
Avatar of l1rz1m
l1rz1m

asked on

how to make an auto date update

hello,
i want to know how can i make the date change itself in www.onlinebetcasino.com (on your left) News & Events.

In addition, i need a code that will allow customers to send mail on this page :

http://onlinebetcasino.com/sup.html

Name - Email - Message, i just need the code that will allow to get mails when submit the form.

Thank you alot
Avatar of scrathcyboy
scrathcyboy
Flag of United States of America image

To make a date change itself on a web page, you need to refresh the page.  I.E. use javascript to get the current date and time when the page initially loads.  That is fine, but will remain static until you reload the page.  To automatically make the page refresh, you need to add this code to the HEAD of the HTML page --

 <HEAD>
<META HTTP-EQUIV=REFRESH CONTENT=5*60>
</HEAD>

That reloads a page every 5 minutes (5 times 60 seconds.).  You can also do this in javascript if interested.
The simple javascript make this possible.
put scri[t in head section of your html and

 "<DIV id="clock" style="FONT-SIZE: 15px;"></DIV>"
where you want to show your watch

thanks
<SCRIPT language=javaScript>
onload = function() {
	thistime= new Date()
	var hours=thistime.getHours()
	var minutes=thistime.getMinutes()
	var seconds=thistime.getSeconds()
	if (eval(hours) <10) {hours="0"+hours}
	if (eval(minutes) < 10) {minutes="0"+minutes}
	if (seconds < 10) {seconds="0"+seconds}
	thistime = hours+":"+minutes+":"+seconds
	document.getElementById('clock').innerHTML=thistime
	var timer=setTimeout("clockon()",200)
}
</SCRIPT>

Open in new window

Avatar of l1rz1m
l1rz1m

ASKER

Hello,
Thank you all for your solutions, i think you didn't understand what i wanted exactly, so let me explain it :

In the page of Index.html you can see the section of News & Events, before, i had to edit the page manually and edit the date for exemple if today is 24/04/2010 i have to download the page and open it with FrontPage and edit the date to 25/04/2010 and so on upload it again for update the News & Events,

Now i want this date which is 24/04/2010 change itself from 24/04/2010 to 25/04/2010 automatically, no need to do it manually, you got me now? any idea?

Thank you
SOLUTION
Avatar of scrathcyboy
scrathcyboy
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of l1rz1m

ASKER

Hello,
I tried this solution but it didn't work, there must be a mistake that i have done, please check the source code  of the page http://www.onlinebetcasino.com/index.html 
Thank you
Move the script I gave above, to the bottom of the <HEAD> section -- put it after all the CSS, and just a line before the closing </HEAD> tag.  See if that helps.  All METAs should come before CSS and javascript.

This line I gave you --
 <!--#config timefmt="%a %d %b %Y -- %I:%M %p" --><!--#echo var="DATE_LOCAL" -->
change it to --

 #config timefmt="%a %d %b %Y -- %I:%M %p"  #echo var="DATE_LOCAL"

If server side includes are enabled on your webserver, that will give the local date and time where the server is located.  See if that works.

Do you have javascript disabled in your browser?  Mine (same code as I gave you) works for me.  Maybe enclose this in a <FONT> tag to make sure it is visible and not hidden.
Avatar of l1rz1m

ASKER

Hi,
I did what you said, check this page to see what it shows :

http://www.onlinebetcasino.com/test/test.html

Please help.

Thank you
Well SSI is not enabled on your web server.  I guess that won't work, but the javascript should work.
Avatar of l1rz1m

ASKER

so any idea please?
The javascript I gave you should have worked.  Maybe there is something on your site that is blocking it.  How often do you need to update the date?
Avatar of l1rz1m

ASKER

the date in News & events must be changed daily with a new date. is there any code with php for exemple?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of James Murrell
any you using PHP: