Count Number of Clicks on a link (Without onclick) [closed]

放肆的年华 提交于 2019-12-04 07:00:06

问题


I have links such as these

"""<a href="http://xyz.com/pz/jjjjj/"><img src="http://xyzsho/mbd.com/42/1319/11110/" alt="" border="0"></a>""""

stored in a mysql database. The user copies these links from some other website and uploads it to the database. These links are now to be displayed on our site. How can I count and store the number of clicks on each link. Here i am unable to use onclick.

I am using PHP and MySQL.

Thanks


回答1:


You need to rewrite the URL to first hit some other server you can use for statistics gathering, and then redirect the user to their initial URL.

This is the sort of thing used by Twitter or Facebook any time you click one of their off-site links.

Essentially, you're writing a URL shortener.



来源:https://stackoverflow.com/questions/12800067/count-number-of-clicks-on-a-link-without-onclick

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!