Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6701033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:53:07+00:00 2026-05-26T06:53:07+00:00

Im using drupal. I have a field which displays a countdown timer. im trying

  • 0

Im using drupal. I have a field which displays a countdown timer. im trying to do something when the time is between 10 and 1 seconds left. Im quite new to php so I’m looking for a starting point.

So how do I express in php, When the timer on the form on nid is between 1 and 10 seconds do something?

Thanks for any help

Edited –
I have Ajax refreshing the page every second to update the timer etc.
How can I get something to happen at a random time between 1 and 10 seconds, does the page have to be being viewed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:53:08+00:00Added an answer on May 26, 2026 at 6:53 am

    Edited – I have Ajax refreshing the page every second to update the timer etc. How can I get something to happen at a random time between 1 and 10 seconds, does the page have to be being viewed?

    The page has to be being viewed in order for anything to happen, since PHP and and Javascript are only loaded upon page view.

    Furthermore, PHP cannot see or manipulate the page after the page loads initially without AJAX. You’d have to use AJAX with Javascript to access the timer and see what time it says. Then you can generate a random number between 1 and 10 and say “if(current_count == rand_time) { … do something … }”, and that would have to be in javascript.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using drupal. I have a form which has a single field, the field
Im using Drupal 6.x. In my page i have the following code which prints
I have a Drupal view which should output a video player using flash. I
My requirement is i have a field created using CCK in Drupal 6, for
I'm using Drupal 6 and have a view with a field having the taxonomy
I am using Drupal and have sifr set on list items, and also a,
I have this website iloveforwards.com created using drupal. I would like to have a
I am using Drupal 6.13, Views 6.x-2.6, Voting API 6.x-2.3, Fivestar 6.x-1.18. I have
Drupal Question: Does anyone have a method of using Views and highlighting a selected/current
I have the occasion to produce Drupal web sites using development, staging, and production

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.