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

  • Home
  • SEARCH
  • 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 8489941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:58:03+00:00 2026-06-10T21:58:03+00:00

I would like to prevent a script from repeating when a user refreshes a

  • 0

I would like to prevent a script from repeating when a user refreshes a web page.

currently, I have a php header file that calls a mysql script that inputs the time a user logs in into my DB. I have noticed that on page refresh, the script is ran again, updating the DB with the time of refresh. This defeats the purpose of obtaining the time of login. The ultimate goal is to determine the length of time a user remains on my site. Is there a better way to go about this?
right now, I am just using the NOW() mysql function to insert the date and time into the DB.

Thank you

  • 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-10T21:58:05+00:00Added an answer on June 10, 2026 at 9:58 pm

    Your login script should direct the user to another page, such as the dashboard or whatever the main page of your site is. Having a whole page just to tell the user they logged in is a case similar to Stopping the Proceedings with Idiocy, so just redirect straight to the main page.

    By performing a redirect, reloading will just reload the main page, it won’t reload the “log me in” part, thus solving your problem and making your site more efficient.

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

Sidebar

Related Questions

I would like to prevent a property from being exposed via my WCF web
I would like to prevent a user from either: Copy and pasting from the
If you have some blocks of code that you would like to prevent execution
I find the question in some sites like ow would you prevent someone from
I'd like to prevent multiple instances of the same long-running python command-line script from
I would like run a PHP script that runs every second to update a
I have a php script that takes a file's id in the url, finds
I would like to open a website in a user's default web browser, however
I have an HTML Table and would like to allow the user to click
I have a Ruby script that defines a class. I would like the script

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.