Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to make Link counters?

Featured Replies

how do you create a counter that counts how many times a link have been clicked and show it below the Link?

 

example:

 

http:www.yahoo.com

(120clicks!)

 

i think it's with a php script..

Yea, I think PHP would be the way to go with MySQL to record everything. If there is a more lightweight option, i'm all ears, this reply is from the hip. I think you would just need a script that added 1 to a row everytime it was clicked and a script to query the DB for that number to return the counter.

You would need a few PHP scripts:

 

1) Each link would have to link to a PHP script such as out.php?url=www.yahoo.com

2) Within that script, you would setup the database connection with a MySQL database, query the database to see if the link already exists - if it does then increment the "clicks" value and if it doesn't, add a new record.

3) You would then need a function that can query the database and return the number of clicks for any given link.

 

Dan

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.