Server side countdown counter script

We can create countdown script in following two ways:

1. Client Side: Time calculations are done on client side.
It can be created using Java Script & jQuery. Client side script will consider client side (local machine) time and not the server side. On each system time can be different so it will not show accurate countdown. So when you execute client side timer from different geographic location you will get different remaining time.

2. Server Side: Time calculations are done on server side.
It can be created using JS/jQuery & PHP (or any server side scripting or programming language). Server side script will consider server time and not the local machine time. It will show same remaining time even though you execute it from any geographic location.

Let’s see how to create server side Countdown counter:

Step 1: Create HTML

Step 2 A: Create JS (Traditional way)

Step 2 B: Create JS (Optimized way)

Step 3: Create PHP script


1 comment

Leave a Reply

Your email address will not be published. Required fields are marked *