Don't worry about it. You clearly put some effort into describing the problem, and given that you are in the Netherlands, I'm guessing English isn't your first language. Its laziness that most people hate around here. We don't mind helping you refine a question if you put the effort in.
First I would suggest that you use a Real Database instead of a CSV file. I would suspect that using a CSV file could lead to file locking and efficiency issues. That said, you can use the DBI interface to CSV which looks like it solves the file locking problem. I've never used it myself, so I can't be certain it would work nicely.
As for the actual problem - when the user clicks on their link, their browser will go to it. If that link goes to a different server, the browser won't send any information back to your server so you can't know that they clicked on that link.
The solution is to have the link point to your server, log the request, and then perform an HTTP redirect.
To do this you have your script change:
<a href="http://www.cvshome.org/">CVS</a>
To:
<a href="my.cgi?gotoSite=1">CVS</a>
Where 1 is a unique identifier for the link. You then look up that entry in the database (in my.cgi), log the visit, then redirect (the CGI.pm perldoc tells you how) to the URL stored in your database.
You should use identifiers and database lookups rather then that URL itself for two main reasons. First, it prevents people using your domain to cloak their dodgy URL, and second it saves you from the effort of having to URL Encode and HTML Encode the string when you generate the webpage.
|