4 members and 60 guests
Most users ever online was 695, 02-16-2011 at 07:01 AM.
» Site Navigation
» Domains For Sale
|
-
Dynamic number on webpage
Hello,
I am pretty well new to creating webpages so I am not even sure this can be done.
I have a number on a webpage that needs to be changed every day. Currently, I am manually changing the number myself. I was wondering if there was a script of some sort that would dynamically change the number at midnight EST.
I realize Javascript is client side and I was almost thinking this would need to be done server side. I just didn't know where to start asking questions.
Any help would be greatly appreciated.
Thank you in advance.
Claudia
-
Hi there flipper828,
I am not, by any means, a PHP expert, but this can be done quite simply...
PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="language" content="english">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>Daily Number</title>
<style type="text/css">
.number {
font-weight:bold;
color:#900;
}
</style>
</head>
<body>
<div>Yesterday's number was <span class="number">
<?php
$yourNumber=5000; // set this value to suit
$dayNumber=date('z');
echo($yourNumber+$dayNumber);
?>
</span>
</div>
<div>Today's number is <span class="number">
<?php
$yourNumber=5000; // set this value to suit
$dayNumber=date('z')+1;
echo($yourNumber+$dayNumber);
?>
</span>
</div>
<div>Tomorrows's number will be <span class="number">
<?php
$yourNumber=5000; // set this value to suit
$dayNumber=date('z')+2;
echo($yourNumber+$dayNumber);
?>
</span>
</div>
</body>
</html>
Save the file with a .php extension.
If you do not have an application like EasyPHP, XAMPP or WampServer on your PC,
then you will need to upload it to your server to test it out.
coothead
-
Thank you Mr. coothead.
I am actually a little familiar with php and enjoy dabbling with it. But I have some questions I have never been able to find an answer for.
I know this may be a REALLY stupic question. But, I was told by my sys admin that the environment my website is on has something to do with IIS and php won't work on it. The code you provided works great on the machine I do my php work on but when I put it on the machine that has my website, nothing shows up but:
Yesterday's number was
Today's number is
Tomorrows's number will be
I understand why there are no numbers but is there a way to get php to work on this iis thing my admin warned me about?
I know I sound stupid and I am sorry.
Thank you again for your willingness to work with me.
flipper828
AKA Claudia
-
Hi there Claudia,
None of your questions are stupid.
Unfortunately, my experience of IIS is non-existent, so all
that I can do is supply you with some very informative links....
- Using FastCGI to Host PHP Applications on IIS 6.0
- Run your favorite PHP applications on IIS today!
- Running PHP Applications on IIS
- Microsoft IIS 7.0 and later
- Microsoft IIS 5.1 and IIS 6.0
Perhaps you and your sys admin may be able to install
PHP after a little study of the above links.
coothead
-
Thank you! Those links are more information that I ever hoped for. I might share it with my sys admin....but then again, I might not. LOL For some reason, I always get the feeling he doesn't like to share his knowledge.
But thank you again for being so kind and nice. I will read over the links and if I can get php to work with the iis, the code you passed on should work beautifully.
I'll be back to share any info I find that might be useful for others.
Claudia
-
No problem, you're very welcome.
Yes, give the sys admin the heave-ho.
coothead
Similar Threads
-
By jwalk1818 in forum HTML / XHTML / XML
Replies: 1
Last Post: 07-19-2007, 02:44 PM
-
By starla in forum Javascript / AJAX / VBScript
Replies: 8
Last Post: 07-30-2005, 03:56 PM
-
By jwalk1818 in forum Javascript / AJAX / VBScript
Replies: 1
Last Post: 04-12-2005, 11:23 PM
-
By bcedergren in forum Javascript / AJAX / VBScript
Replies: 1
Last Post: 03-05-2003, 12:35 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|