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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:07:37+00:00 2026-05-23T07:07:37+00:00

1) How do I add a simple page counter to a PHP page and

  • 0

1) How do I add a simple page counter to a PHP page and insert the values in a MySQL table? Also I would need the MySQL table value to be updated with each new visit.

2) The trick is that the PHP page is a template for a variety of user generated landing pages. For example, I would like each of these pages to have their own separate counters:

examplesite.com/template.php?getvalue=bob

examplesite.com/template.php?getvalue=sam

examplesite.com/template.php?getvalue=samantha

My impression is that if I put the counter on the “template.php” file then it will add up all the visits from each user to a grand total. The output that I would like is to have each user only get counts for the individual landing page.

So, if there are a total of 12 visits, dispersed as follows:

examplesite.com/template.php?getvalue=bob  had 4 visits

examplesite.com/template.php?getvalue=sam  had 2 visits

examplesite.com/template.php?getvalue=samantha  had 6 visits

then I would want bob’s page counter to read as ‘4’, sam’s as ‘2’ and samantha’s as ‘6.’ Am I correct in assuming that if I just put the counter on template.php that each user’s landing page would read as ’12?’ Do you have a solution for an easy way to fix this?

  • 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-23T07:07:37+00:00Added an answer on May 23, 2026 at 7:07 am

    Well, just as you are able to separate the requests for bob and sam when generating the page, you can do the same for the counter?

    You’ll probably do something with $_GET['getvalue']. Just use that value (escaped, paramterized etc) in a query to update your counter….

     UPDATE yourtable SET count = count + 1 WHERE pagename = ?
    

    and then bind the getvalue…

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

Sidebar

Related Questions

I would like to add a page to an existing PDF document containing simple
Below is an exceedingly simple HTML page. 1) I would like to add a
I'm trying to add simple login page to ASP.NET MVC app. I actually use
When you edit a simple page in the design view, you can add an
I am trying to add a draggable object to to a simple html page.
I'm writing a simple VS add-in and would like to programmatically invoke the Document
I want to add a simple one-page HTML page help to my Cocoa app.
I am trying to add a simple comments/message box to a web page. When
I want to add unique hit counter to my website using PHP. So this
I'm trying to add a simple page x of y to a report made

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.