473,394 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Show countdown from 10 to 0 seconds

I have a newbie question (couldn't find the answer with google)
How to show countdown from 10 to 0 seconds.

Stephanie
Jul 27 '05 #1
31 14100
I have a newbie question (couldn't find the answer with google)
How to show countdown from 10 to 0 seconds.

Stephanie


Cannot really be done with PHP, try JavaScript.

Simon
Jul 27 '05 #2
> Cannot really be done with PHP, try JavaScript.
Bad luck, i try to avoid JavaScript. Some visitors disabled JavaScript.

Stephanie
Jul 27 '05 #3
Cannot really be done with PHP, try JavaScript.

Bad luck, i try to avoid JavaScript. Some visitors disabled JavaScript.

Stephanie


Who is it bad luck for?
PHP is _server side_ a countdown is _client side_.

Simon
Jul 27 '05 #4
Stephanie wrote:
Cannot really be done with PHP, try JavaScript.


Bad luck, i try to avoid JavaScript. Some visitors disabled JavaScript.

Stephanie


the number of people who know how to disable javascript is minute.

of the people who *do* know how to disable javascript, very few bother
to do so.

i imagine that those people who *both* know how to disable it and
*actually* disable it are probably going to manage to surf your site
without the help of a countdown ticker.
sadara
Jul 27 '05 #5
My oppinion is that the best way is Flash !!!
Just for the CountDown...
I don't think that someone will be afraid of flash !!!
Jul 27 '05 #6
> PHP is _server side_ a countdown is _client side_.

Why can't you countdown server sided ?

Stephanie
Jul 27 '05 #7
Stephanie wrote:
PHP is _server side_ a countdown is _client side_.


Why can't you countdown server sided ?


Your question is not clear. Do you want countdown to be shown in
browser (inputbox, div, etc)?? or You just want to countdown the
seconds (say 10 seconds of sleep)??

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com

Jul 27 '05 #8
On Wed, 27 Jul 2005 15:22:52 +0200, Stephanie wrote:
PHP is _server side_ a countdown is _client side_.


Why can't you countdown server sided ?


You can, but the client won't see it. What do you need the countdown for,
anyway? If it's just for a more or less arbitrary delay, use an animated
gif and refresh the page using the 'meta refresh' header set at 10 sec.

I hate countdowns that don't do anything.

--
Firefox Browser - Rediscover the web - http://getffox.com/
Thunderbird E-mail and Newsgroups - http://gettbird.com/
Jul 27 '05 #9
JDS
On Wed, 27 Jul 2005 13:39:32 +0200, Sadara wrote:
of the people who *do* know how to disable javascript, very few bother to
do so.


Roughly 10% do, depending on where you get your numbers

--
JDS | je*****@example.invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

Jul 27 '05 #10
JDS
On Wed, 27 Jul 2005 12:08:42 +0100, Simon wrote:
I have a newbie question (couldn't find the answer with google)
How to show countdown from 10 to 0 seconds.

Stephanie


Cannot really be done with PHP, try JavaScript.

Simon


Or you can META Refresh at one second intervals, loading the next
incremented number page each time.

Or you could use an animated GIF

Or you could use Flash (as another poster suggested).

Or possibly a Java Applet.

I vote for JavaScript, though.

--
JDS | je*****@example.invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

Jul 27 '05 #11
JDS
On Wed, 27 Jul 2005 13:00:55 +0200, Stephanie wrote:
I have a newbie question (couldn't find the answer with google) How to
show countdown from 10 to 0 seconds.

Stephanie

Your question is too unspecific/ambiguous.

What are you trying to do, exactly?

Why do you want to do it?

Why do you think it would be PHP-related, this question?

More details, please...

--
JDS | je*****@example.invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

Jul 27 '05 #12
I have an errorpage that redirects after 10 seconds. So i'd like to show how
many seconds before redirection.
Within that time a visitor can chose to send an email to the webmaster.
So it's not entirely necessary, but it's a service :-))
So i need some advice to show (not how to redirect within 10 seconds) the
remaining seconds within my text.(not a textbox or somthing)
(Sorry, this page was not found. In 10 seconds, you will be redirected to
our main page.)

Stephanie
Jul 27 '05 #13
Stephanie wrote:
I have an errorpage that redirects after 10 seconds. So i'd like to show how
many seconds before redirection.
Within that time a visitor can chose to send an email to the webmaster.
So it's not entirely necessary, but it's a service :-))
So i need some advice to show (not how to redirect within 10 seconds) the
remaining seconds within my text.(not a textbox or somthing)
(Sorry, this page was not found. In 10 seconds, you will be redirected to
our main page.)


Then.. probably, you may have to try something like this
<http://in2.php.net/flush#52147> with META refresh.

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com

Jul 27 '05 #14

"Stephanie" <St*******@nospam.1234> wrote in message
news:bd***************************@news.versatel.n l...
I have an errorpage that redirects after 10 seconds. So i'd like to show
how many seconds before redirection.
Within that time a visitor can chose to send an email to the webmaster.
So it's not entirely necessary, but it's a service :-))
So i need some advice to show (not how to redirect within 10 seconds) the
remaining seconds within my text.(not a textbox or somthing)
(Sorry, this page was not found. In 10 seconds, you will be redirected to
our main page.)


Ah, yes, this is a javascript question. To make it usable for those with js
turned off, just provide a regular link under your timer thing. "if you are
not automagically redirected, or dont want to wait, click here" You should
do that anyway, so I dont have to wait.

--
juglesh
Jul 27 '05 #15
SOR
<comp.lang.php , Stephanie , St*******@nospam.1234>
<c2**************************@news.versatel.nl>
<Wed, 27 Jul 2005 13:00:55 +0200>
I have a newbie question (couldn't find the answer with google)
How to show countdown from 10 to 0 seconds.


- print 10 on the screen
- while loop timed for a one second delay
- print 9 on the screen
- repeat until 0

But using some sort of witty animated gif to amuse the user until the
refresh takes place would probably be much better .
Jul 27 '05 #16
I have a newbie question (couldn't find the answer with google)
How to show countdown from 10 to 0 seconds.


- print 10 on the screen
- while loop timed for a one second delay
- print 9 on the screen
- repeat until 0

But using some sort of witty animated gif to amuse the user until the
refresh takes place would probably be much better .


Have you even tried it yourself to see what happens?

Simon
Jul 27 '05 #17
SOR
<comp.lang.php , Simon , sp********@example.com>
<3k************@individual.net>
<Wed, 27 Jul 2005 17:32:09 +0100>
- print 10 on the screen
- while loop timed for a one second delay
- print 9 on the screen
- repeat until 0

But using some sort of witty animated gif to amuse the user until the
refresh takes place would probably be much better .


Have you even tried it yourself to see what happens?


Of course not :-)
Jul 27 '05 #18
Stephanie wrote:
I have an errorpage that redirects after 10 seconds. [...] it's a service :-))


You misspelt 'disservice'. Good luck with it though.

--
Jock
Jul 27 '05 #19
SOR
<comp.lang.php , John Dunlop , us*********@john.dunlop.name>
<MP************************@news.ntlworld.com>
<Wed, 27 Jul 2005 17:21:35 GMT>
I have an errorpage that redirects after 10 seconds.

[...]
it's a service :-))


You misspelt 'disservice'. Good luck with it though.


What if you nip in and out of php when doing the loop .

Surely there must be some way to achieve the effect .
Jul 27 '05 #20
SOR wrote:
What if you nip in and out of php when doing the loop .
I'd nip that loopy idea in the bud right now, SOR!
Surely there must be some way to achieve the effect .


Of course, for some, some of the time.

--
Jock
Jul 27 '05 #21
On Wed, 27 Jul 2005 13:25:02 +0200, Stephanie wrote:
Cannot really be done with PHP, try JavaScript.

Bad luck, i try to avoid JavaScript. Some visitors disabled JavaScript.

Stephanie


But as PHP is a server side scripting language, how do you expect to
implement this client side functionality?

Steve
Jul 27 '05 #22
I noticed that Message-ID:
<MP************************@no-cancel.newsreader.com> from SOR contained
the following:
You misspelt 'disservice'. Good luck with it though.


What if you nip in and out of php when doing the loop .

Surely there must be some way to achieve the effect .


How many times have you waited more than a second for a busy server to
respond? A very small animated gif, maybe like a progress bar, would be
my favourite.
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 27 '05 #23
SOR
<comp.lang.php , Geoff Berrow , bl******@ckdog.co.uk>
<ap********************************@4ax.com>
<Wed, 27 Jul 2005 19:34:00 +0100>
What if you nip in and out of php when doing the loop .

Surely there must be some way to achieve the effect .


How many times have you waited more than a second for a busy server to
respond?


I'm on a dialup up not the best person to say .
Jul 27 '05 #24
> Or you can META Refresh at one second intervals, loading the next
incremented number page each time.

Or you could use an animated GIF

Or you could use Flash (as another poster suggested).

Or possibly a Java Applet.

I vote for JavaScript, though.


Is this "comp.lang.php"? if not then all your sugestions are indeed valid.

Simon
Jul 27 '05 #25
Stephanie wrote:
I have a newbie question (couldn't find the answer with google)
How to show countdown from 10 to 0 seconds.

Stephanie


actually you could try with flush or meta refresh...but safest bet is with
gif..second would be javascript

--
Dominik Susmel | art director
www.vongestern.com | vonGestern art company . Zagreb, Croatia
Jul 27 '05 #26
SOR <we*******@sparesorrepair.co.uk.INVALID> wrote:
<comp.lang.php , Simon , sp********@example.com>
<3k************@individual.net>
<Wed, 27 Jul 2005 17:32:09 +0100>
> - print 10 on the screen
> - while loop timed for a one second delay
> - print 9 on the screen
> - repeat until 0
>
> But using some sort of witty animated gif to amuse the user until the
> refresh takes place would probably be much better .


Have you even tried it yourself to see what happens?


Of course not :-)


I'll tell you what would happen. The user would see nothing at all for a
ten-second delay, followed by "10 9 8 7 6 5 4 3 2 1 0", displayed all at
once.

HTTP is not an "interactive" facility. The contents of a page are batched
up and transmitted in large chunks.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Jul 28 '05 #27
Simon wrote:
Or you can META Refresh at one second intervals, loading the next
incremented number page each time.

Or you could use an animated GIF

Or you could use Flash (as another poster suggested).

Or possibly a Java Applet.

I vote for JavaScript, though.

Is this "comp.lang.php"? if not then all your sugestions are indeed valid.

Simon


Simon,

They suggestions are still valid. The request was for a php solution. There
isn't one - but people were nice enough to provide alternatives rather than just
saying "it can't be done".

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jul 29 '05 #28
Thx, all of you.
Interesting discussion. I have to think about it.

Stephanie
Jul 29 '05 #29
>>>Or you can META Refresh at one second intervals, loading the next
incremented number page each time.

Or you could use an animated GIF

Or you could use Flash (as another poster suggested).

Or possibly a Java Applet.

I vote for JavaScript, though.

Is this "comp.lang.php"? if not then all your sugestions are indeed
valid.

Simon


Simon,

They suggestions are still valid. The request was for a php solution.
There isn't one - but people were nice enough to provide alternatives
rather than just saying "it can't be done".


That is not the impression I got from the reply.
The reply was directed at me and not the OP, furthermore the list of other
options given (to me), was not really helpful to the OP.

Simon
Jul 29 '05 #30
JDS
On Fri, 29 Jul 2005 07:09:21 +0100, Simon wrote:
The reply was directed at me and not the OP, furthermore the list of other
options given (to me), was not really helpful to the OP.


It wasn't helpful?

--
JDS | je*****@example.invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

Jul 29 '05 #31
>
The reply was directed at me and not the OP, furthermore the list of
other
options given (to me), was not really helpful to the OP.


It wasn't helpful?


IMHO, the list given does not really answer the OP's question.

Simon
Jul 29 '05 #32

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Bonnett | last post by:
I have been creating a generic countdown timer (source code below), counting the seconds, minutes, hours and days till an event, but I have having trouble with it finding out how many hours are...
8
by: Michael | last post by:
I have this script that works the way I want except for one thing... Once it hits zero it starts to count up and looks like this: -1:0-1:0-1:0-18 with the last number counting up. Can anyone...
1
by: Will | last post by:
I have form showing instructions and logging actions and I would like the form to show a count down timer for a certain period of time. E.g. 30 secs, going down to 0 and then displaying the action....
3
by: james | last post by:
I am working with a very old database system (building an import/export routine) that stores the time in seconds. I have been able to convert the seconds to correct time (thanks to a lot of help in...
4
by: Dr John Stockton | last post by:
I'm starting a new thread, for clarity. I'm assuming that it's ECMA-262 3rd Edn (1999) that we should be using for Web pages; that 4th Edn (what's its present status? is it available?) is too...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.