Short URL Outbound Link Tracking in PHP and MySQL -


I have a site that reduces the link based on this topic. I decided that it would be great if users click on a small URL, like HootSuite users can track their links. I currently have a database in which the short URL is placed with the actual URL and this click count will ideally update the click count column when that small URL is accessed by an external user.

In short, I am looking for a PHP / MySQL solution so that many small URLs can be clicked. . Any additional information gathered from the clicks will also be highly appreciated.

I'm assuming you followed the PHP version of your tutorial. If so, look at listing for service.php under "service of small URL". In section round line 11 where it determines the position of 301, you can redirect with the database update. Something like

  $ query = mysql_query ("update`" $ database. "` .```_AL_DIRED`Set count = count + 1 where` small '=' ".mysql_escape_string ($ short) , $ Db); $ Line = mysql_execute_update ($ query);  

Should do this.


Comments