note
barrd
Hiya [Petras],<br>
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.
<p>
Step in relational Db. I use [http://www.mysql.com|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;
<p>
<ul type="disc">
<li>UID (Unique ID)
<li>Name of promotion (or in your case charity)
<li>Clicks (number of hits)
<li>Image (usually just a name or path)
<li>URL link
<li>Header text - optional (HTML)
<li>Footer text - optional (HTML)
<li>Created (date promotion started)
<li>LastMod (date link was last clicked in this case)
<li>Active ("Yes" or "No")
</ul>
<p>
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 <b>that</b> up a "long time ago"... ;)
<p>
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 <code>/msg barrd</code> in the ChatterBox.
<p>
Best of luck...
306470
306470