Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

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

License

Notifications You must be signed in to change notification settings

jluo98/PHP-Redirect-Click-Counter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PHP Redirect Click Counter

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
// MySQL Database
$servername = "localhost";      // MySQL Host
$username = "user";             // Username for you database
$password = "pass";             // Password with your username
$dbname = "database";           // Database Name
  • Put modified redirect.php and click.php to your server for public access.

Usage

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

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

To see click records, just visit

https://example.com/clicks.php

If no http or https query is in the forward string, http:// will be automatically added.

Use //www.google.com if you do not want to specify a query type.

Demo

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

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

To view records:

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

License

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages