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 8548307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:27:54+00:00 2026-06-11T13:27:54+00:00

I have a page which redirects a user after 10 seconds with the following

  • 0

I have a page which redirects a user after 10 seconds with the following code.

<META HTTP-EQUIV="refresh" CONTENT="10;URL=login.php">

I then have this code which is echo’d in PHP, and would like the “10” (seconds) to countdown dynamically as 10, 9, 8, 7… so the user can see the seconds left until the page redirects.

echo "We cant find you on the system. <br/> Please return to the <b><a href='login.php'>Login</a></b> page and ensure that <br/>you have entered your details correctly. 
<br>
<br>
<b>Warning</b>: You willl be redirected  back to the Login Page <br> in <b>10 Seconds</b>";

I was wondering if there was a way that this can be done in PHP, if not what would be the best way to achieve the same?

  • 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-06-11T13:27:55+00:00Added an answer on June 11, 2026 at 1:27 pm

    The following will redirect the user right away to login.php

    <?php
    header('Location: login.php'); // redirects the user instantaneously.
    exit;
    ?>
    

    You can use the following to delay the redirection by X seconds but there is no graphical countdown (thanks to user1111929):

    <?php
    header('refresh: 10; url=login.php'); // redirect the user after 10 seconds
    #exit; // note that exit is not required, HTML can be displayed.
    ?>
    

    If you want a graphical countdown, here’s a sample code in JavaScript:

    <p>You will be redirected in <span id="counter">10</span> second(s).</p>
    <script type="text/javascript">
    function countdown() {
        var i = document.getElementById('counter');
        if (parseInt(i.innerHTML)<=0) {
            location.href = 'login.php';
        }
        if (parseInt(i.innerHTML)!=0) {
            i.innerHTML = parseInt(i.innerHTML)-1;
        }
    }
    setInterval(function(){ countdown(); },1000);
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following in a .htaccess file redirect 301 /page.php http://domain.com/page Which works
I have a basic .ASP page like this, which when hit redirects the user
I have a form that redirects to the same page after a user enters
I have a javascript function which redirects user to a diff page. It goes
I have an webpage which posts some data and then redirects to a page
I have DropDownList, which has some options to choose from. Now after when user
I have a page which submits a form on page load and redirects the
I have an edit page which is used from different sources. After editing I
I have a page which needs to redirect a user to another separate system
I have one interceptor, in which I hv to redirect to main Page if

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.