By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,053 Members | 1,161 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,053 IT Pros & Developers. It's quick & easy.

Link click detection?

P: n/a
How might one detect if someone clicked on a hyperkink at your website,
so it can be logged in a database? This would have to be done before
the browser redirects.

Thanks for your help.
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Bruce W...1 <br***@nodirectemail.com> wrote:
How might one detect if someone clicked on a hyperkink at your website,
so it can be logged in a database? This would have to be done before
the browser redirects.


The only way you can be sure is to not put any external links on your
pages directly, but have them point to a redirect script. That script
will take a GET parameter and redirect the browser to the givven url
after loggin whatever you might seem fit.

redir.php
<?php
doLogginStuff();

header("Location: {$_GET['url']}");
?>

BTW don't forget to urlencode the actual url.

--

Daniel Tryba

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.