Hi,
In terms of graphs, those could simply be tables that are generated and their widths and heights are set by your php script depending on the values. Goto www.sourceforge.net for scripts and either use a ready made open-source one from there, or use it to learn what to do to create your own.
Affiliate programs. All you need to do is have a table in a database for the affilates. When they register, they are assigned an affiliate ID. This could be an auto_increment field in mysql. Then, when they link to your site, they use a URL querystring, eg, www.experts-exchange.co.za?AffiliateID=124.
On your site, you have a standard include page on all your pages with code like the following:
if($_GET["AffiliateID"] != "")
{
$_SESSION["AffiliateID"] = $_GET["AffilateID"];
}
?>
Now you check on your sales page if the session variable is set, and if it is, you credit that account with a commision.
For click tracking, you check the server variables for IP address, referer, etc. Then in your standard header, you write all these values to a database.
eg, here are two entries from my database.
----------------------------------------------------------------------------------
"8212"
"www.experts-exchange.co.za/questions/category.php?CategoryID=2"
"74.6.69.220"
"Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
"20070707"
"1228"
"0"
"8213"
"www.experts-exchange.co.za/"
"65.36.241.81"
"InternetSeer.com"
"20070707"
"1249"
"0"
-------------------------------------------------------------------------
As you could imagine, this could get very big, so you should monitor it if server hosting space is limited. You would then need to write some pages to display this in some kind of helpful order. Eg, if you displayed by IP address, you would be able to see where users came from, which pages they viewed and how long they were on each page.
If you need help with knowing which server variables (http header variables) to include post back here and ask..
John
----------------------------------------------------------------------------------
http://www.experts-exchange.co.za -- Free IT Q&A