PHP Question
#1

hello guys, i have one question please
Do anyone know How to settimer on PHP and after that timer completed (After every 1 second) something will happen/update
Reply
#2

PHP is server-sided so you need to combine PHP and Javascript.
Use PHP to show your basic page. Then implement a Javascript timer that ticks every second.
If the timer completes, you will need to implement a Ajax function that is called when the timer finished.
This Ajax script should call a PHP script / page and so you can get data without refreshing or loading a page.

More info: search in ****** for 'PHP and Ajax'

But if you simply wants to call a new page or change/add/remove content after few seconds, you can easily use a Javascript timer without Ajax or PHP.

The only one timer i know is these one type of timers: http://stackoverflow.com/questions/8...op-a-timer-php
This type of timer is created to count the time that is elapsed during doing some functions
Reply
#3

Quote:
Originally Posted by Alf21
Посмотреть сообщение
PHP is server-sided so you need to combine PHP and Javascript.
Use PHP to show your basic page. Then implement a Javascript timer that ticks every second.
If the timer completes, you will need to implement a Ajax function that is called when the timer finished.
This Ajax script should call a PHP script / page and so you can get data without refreshing or loading a page.

More info: search in ****** for 'PHP and Ajax'

But if you simply wants to call a new page or change/add/remove content after few seconds, you can easily use a Javascript timer without Ajax or PHP.

The only one timer i know is these one type of timers: http://stackoverflow.com/questions/8...op-a-timer-php
This type of timer is created to count the time that is elapsed during doing some functions
Okay thanks Sir i will try using your Suggestion
Reply
#4

What kind of things is the PHP script doing?
Reply
#5

Quote:
Originally Posted by BlackBank3
Посмотреть сообщение
What kind of things is the PHP script doing?
http://php.net/manual/en/
Reply
#6

Quote:
Originally Posted by Zorono
Посмотреть сообщение
I know what PHP is and does, but what kind of PHP script did you write? What's the purpose of your PHP script?
Reply
#7

My Server's Site
Reply
#8

Quote:
Originally Posted by Zorono
Посмотреть сообщение
My Server's Site
Where do you need the timer function for? Because i can't imagine using it for a site (server-side).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)