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
l1rz1mAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

scrathcyboyCommented:
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.
0
nareshtankCommented:
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

0
l1rz1mAuthor Commented:
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
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

scrathcyboyCommented:
YES.  Put exactly THIS at the place in the page where you want the current date to appear --

<SCRIPT language="javascript">timeDate()</script>
 <!--#config timefmt="%a %d %b %Y -- %I:%M %p" --><!--#echo var="DATE_LOCAL" -->


Then in the HEAD of the page, put this JAVASCRIPT -- after the <HEAD> tag and before </HEAD> tag --

<SCRIPT language="javascript">
<!--
function timeDate() {
var today = new Date();
var day   = today.getDay();
var date  = today.getDate();
var month = today.getMonth() + 1;
var year  = today.getFullYear();
var mins = today.getMinutes();
var hours = today.getHours();
   if (mins < 10) mins = '0' + mins;
   if (hours < 12)  {mins = mins + "am";}
   if (hours == 12)  {mins = mins + "pm";}
   if (hours > 12)  {hours = hours-12; mins = mins + "pm";}
document.write(hours +":" + mins + ", " + d[day] + ' ' + date + ' ' + m[month-1] + ' ' + year);
}
//--></SCRIPT>


Do that EXACTLY and it will work.  I have had it working on my site for 5 years !!
It gives the date and time.
0
l1rz1mAuthor Commented:
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
0
scrathcyboyCommented:
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.
0
l1rz1mAuthor Commented:
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
0
scrathcyboyCommented:
Well SSI is not enabled on your web server.  I guess that won't work, but the javascript should work.
0
l1rz1mAuthor Commented:
so any idea please?
0
scrathcyboyCommented:
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?
0
l1rz1mAuthor Commented:
the date in News & events must be changed daily with a new date. is there any code with php for exemple?
0
scrathcyboyCommented:
It is fairly simple with PHP:

<?php
print strftime('%c');
?>

Output:

Wed Apr 28 01:22:58 2010

You need to pass format such as %c to strftime() to print date and time representation for the current system. You can use following format characters:

    * %m - month as a decimal number (range 01 to 12)
    * %d - day of the month as a decimal number (range 01 to 31)
    * %Y - year as a decimal number including the century
    * You can see the complete format conversion specifiers online here

You can also use date() as follows:

<?php
 print date('r');
 print "\\n";
 print date('D, d M Y H:i:s T');
 print "\\n";
?>

Output:

Wed, 28 Apr 2010 01:29:56 +0530
Wed, 28 Apr 2010 01:35:14 IST

You need to pass r format conversion to print formatted date. See the complete format conversion specifiers online here
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
James MurrellProduct SpecialistCommented:
any you using PHP:
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development Software

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.