I am working on a web with php (laravel 5.4) and I have to generate several links that the user clicking on them does not let you know that the click originated from my web page. The idea is that it seems that the user wrote the link directly in the browser, and that does not relate in any way that clicked from my website. how can I do it? Thanks for your help.
Asked
Active
Viewed 171 times
0
-
An upvote for a good question, often employed technique by government sites. – Shakti Phartiyal Mar 09 '17 at 18:05
-
Do you mean to hide HTTP_REFERER? – oneNiceFriend Mar 09 '17 at 18:08
-
The question is way too broad and is a duplicate @ShaktiPhartiyal – Jay Blanchard Mar 09 '17 at 19:50
1 Answers
0
You can do that using javaScript. You need to define a function that accepts a url as parameter and calls the javascript window.open()
.
Make a regular tag and in its href attribute pass javascript:void(0);
so that the default link click action is stopped.
Now define an attribute onClick
and call your defined function here and pass the url you want to open.
Please see the example below:
<script type="text/javascript">
function openURL(url)
{
window.open(url);
}
</script>
<a href = "javascript:void(0);" onClick="openURL('http://google.com');">GOOGLE</a>

Jay Blanchard
- 34,243
- 16
- 77
- 119

Shakti Phartiyal
- 6,156
- 3
- 25
- 46