• We just launched and are currently in beta. Join us as we build and grow the community.

Personal Count Total Visited Using HTML JavaScript

LunarEclipse

Static Analysis Expert
L Rep
0
0
0
Rep
0
L Vouches
0
0
0
Vouches
0
Posts
113
Likes
109
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1 400 XP
Personal Count Total Visited tallies and displays the number of visitors by the current page. It will use cookies to accomplish this task. The number of visitors in your site will be counted automatically through this script. You will know the number of people who visits your site.

Example:

Count Total Visited

You have visited this page times.

(Reload page to see it works)

Directions:

First: Kindly add the code below to the HEAD section of your page.

  1. <style type=

    "text/css"

    >
  2. .counter_style

    {
  3. background-color

    :

    black

    ;
  4. color

    :

    cyan

    ;
  5. font-weight

    :

    bold

    ;
  6. }

  7. p {
  8. font-size

    :

    18px

    ;
  9. font-weight

    :

    bold

    ;
  10. {
  11. </style>

  1. <

    script type=

    "text/javascript"

    lang=

    "Eng"

    >
  2. expireDate =

    new

    Date
  3. expireDate.setMonth

    (

    expireDate.getMonth

    (

    )

    +

    6

    )
  4. count_num =

    eval(

    cookieVal(

    "counter_style_Visited"

    )

    )
  5. count_num++
  6. document.cookie

    =

    "counter_style_Visited="

    +

    count_num+

    ";expires="

    +

    expireDate.toGMTString

    (

    )

  7. function

    cookieVal(

    cookieName)

    {
  8. thisCookie =

    document.cookie

    .split

    (

    "; "

    )
  9. for

    (

    i=

    0

    ;

    i<

    thisCookie.length

    ;

    i++

    )

    {
  10. if

    (

    cookieName ==

    thisCookie[

    i]

    .split

    (

    "="

    )

    [

    0

    ]

    )

    {
  11. return

    thisCookie[

    i]

    .split

    (

    "="

    )

    [

    1

    ]
  12. }
  13. }
  14. return

    0
  15. }

  16. function

    page_countvisit(

    )

    {
  17. for

    (

    i=

    0

    ;

    i<

    (

    7

    -

    count_num.toString

    (

    )

    .length

    )

    ;

    i++

    )
  18. document.write

    (

    '<span class="counter_style">0</span>'

    )
  19. for

    (

    y=

    0

    ;

    y<

    (

    count_num.toString

    (

    )

    .length

    )

    ;

    y++

    )
  20. document.write

    (

    '<span class="counter_style">'

    +

    count_num.toString

    (

    )

    .charAt

    (

    y)

    +

    '</span>'

    )
  21. }

  22. </

    script>

Second: Where you want the Personal Count Total Visited appear in your page, kindly insert this script.

You have visited this page <script

type

=

"text/javascript"

lang

=

"Eng"

>

page_countvisit(count_num);</

script

>

times.


Download
You must upgrade your account or reply in the thread to view the hidden content.
 

452,292

324,135

324,143

Top