A simple php script to record click count and redirect a url.

Installation

This project is written in PHP, using MySQL as its primary database.

  • Modify MySQL information at the beginning of both redirect.php and click.php according to your settings

  • Put modified redirect.php and click.php to your server for public access.

Usage

If you want to redirect to http://www.google.com, just visit

http://example.com/redirect.php?forward=http://www.google.com

To see click records, just visit

http://example.com/clicks.php

Demo

To create/update a record and redirect to a url:

http://demo.steve-luo.com/php-redirect-click-counter/redirect.php?forward=https://www.google.com

To view records:

http://demo.steve-luo.com/php-redirect-click-counter/clicks.php

Source Code

Source code can be found at my GitHub: 

https://github.com/Steve-luo/PHP-Redirect-Click-Counter