472,096 Members | 2,204 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,096 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 13880
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Bonnett | last post: by
8 posts views Thread by Michael | last post: by
3 posts views Thread by james | last post: by
4 posts views Thread by Dr John Stockton | last post: by

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.