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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:00:57+00:00 2026-06-10T01:00:57+00:00

I am creating a simple website using HTML and JavaScript in dreamweaver. On my

  • 0

I am creating a simple website using HTML and JavaScript in dreamweaver. On my home page, I want to show an alert (whenever my home page loads), which says that “Hello, you are visitor no. 12. Welcome to my site!”. I want this visitor number to change on every page load of home.html.

I basically want the visitor no. to be stored in a cookie and increase the no. by 1 in the cookie every time the page refreshes.

How can I create such an alert? Please help. Thanks.

Also, I want to know if I add this functionality, would it be an example of dynamic content on a web page or do you HAVE to create database connections and all in order to create dynamic content. Wouldn’t this idea of creating cookie also an example of dynamic content?

Edit-1

I want that only. How many times page was visited. I am a beginner and want it all simple. I just want to know how I can store the no. of visits in a cookie and then retrieve that value from that cookie and show it in an alert on page load. Thanks.

  • 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-10T01:00:58+00:00Added an answer on June 10, 2026 at 1:00 am

    To make it really simple for you (without using the database) you can store the number in a .txt file in the server, and use a simple scripting language like PHP to send it in a hidden field to the client. Every time the PHP page runs, it will have to get the current number and increment it. Something like this:

    $myFile = "counter.txt";
    $fh = fopen($myFile, 'r');
    $count = fgets($fh);
    $count++;
    fclose($fh);
    
    $fh = fopen($myFile, 'w');
    fwrite($fh, $count); // write the incremented counter
    fclose($fh);
    
    echo "<input type='hidden' id='counter' value='$count'>";
    

    Then, you would have to get this counter value from the javascript (client side) and alert to the user.

    var visitCount = document.getElementById('counter');
    alert("Hello, you are visitor no. "+visitCount+". Welcome to my site!");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Creating a website using simple html(not html5) and css but got stock in mouseover
I am creating a simple(ish) website for one of my iPhone apps using the
I'm re-creating a registration for my website using Codeigniter. On my previous page, I
I'm looking for help/advice with creating simple JSP website using equivalent of PHP include+switch
I'm creating a website using Entity Framework (4.1), which exposes WCF services, and I
I'm creating a sample website using xhtml with javascript support. Also using php for
I'm creating an HTML email using a large image with an image map, which
I am creating a simple search function for my website using MySQL and PHP.
I'm looking for a simple Python framework/library for creating a website run using PyPy.
I am creating a website using JavaScript. The purpose of the JS part is

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.