Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Counting click-throughs

by barrd (Parson)
on Nov 12, 2003 at 14:43 UTC ( #306534=note: print w/ replies, xml ) Need Help??


in reply to Counting click-throughs

Hiya Petras,
Thought I'd carry on a little from where Brer Aristotle left off. I've done many types of this over the years and would like to give a wee bit of advice. I started out by using flatfiles and the exact same technique as above to keep a count (the link went through a CGI opened the appropriate text file and then auto increment the number). However this gets messy pretty quickly and is hard to maintain.

Step in relational Db. I use MySQL but any other SQL Db would suffice. the reason I do this is to allow better control via a backend admin script to control all the elements of the promotion. Below is a basic typical setup I might have for an SQL table containing the fields;

  • UID (Unique ID)
  • Name of promotion (or in your case charity)
  • Clicks (number of hits)
  • Image (usually just a name or path)
  • URL link
  • Header text - optional (HTML)
  • Footer text - optional (HTML)
  • Created (date promotion started)
  • LastMod (date link was last clicked in this case)
  • Active ("Yes" or "No")

This means that your front end (HTML) page interacts directly with your back end admin script (via the Db) meaning that if you are capable of doing this (dynamic page building) not have to edit any hard coded HTML. I gave that up a "long time ago"... ;)

Anyway hopefully that might have given you an insight to a more proactive way of handling this situation. If you have any other questions either reply to this post or /msg barrd in the ChatterBox.

Best of luck...


Comment on Re: Counting click-throughs
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://306534]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2014-07-28 13:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (198 votes), past polls