javascript - 如何获取我的链接被点击的位置

标签 javascript php jquery hyperlink

考试我有一个网站:mysites1.com 我有一个这样的网站网址

mysites.com/hellowolrd.

当别人把这样的内容放在mysite2.com上

Hello this is my site <a href='http://mysites.com/hellowolrd'>

我怎么知道这个链接是从 othersite.com 点击的? 是否有任何 api 或服务帮助? 非常感谢

最佳答案

在php $_SERVER['HTTP_REFERER'];中使用HTTP_REFERER获取referer站点,完整用法请看这里

http://www.php.net/manual/en/reserved.variables.server.php

http://www.electrictoolbox.com/php-http-referer-variable/

关于javascript - 如何获取我的链接被点击的位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22142258/

相关文章:

jQuery 将 href 链接分配给其父元素

javascript - 关于Jquery/Javascript和NPAPI chrome问题

php - xpath 排除具有类的元素

javascript - 您应该检查 ajax 返回数据还是让 javascript 对空数据抛出错误?

php - 用php建立一个插件系统

php - SQL错误: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax

javascript - JQuery 表单提交时的多个 POST

javascript - 悬停时显示 div,不悬停时隐藏

javascript - Android 4.0浏览器溢出: scroll and touch/click events

javascript - 相对定位元素原始位置的点击事件