Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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...


In reply to Re: Counting click-throughs by barrd
in thread Counting click-throughs by Petras

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-03-28 21:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found