Question:
How are the below stuff created with php ?
2007-07-10 03:37:25 UTC
graphs&bars
affiliate programs
click tracking
music libraries
chat systems

i don't want tutorials...i know to code in php and i just want an idea how are they structured...
Three answers:
2007-07-10 04:14:35 UTC
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
kolibrizas
2007-07-10 04:14:19 UTC
It is too hard to answer, i will write for a week this code, and my, i think everone's time costs a lot! try finding free source or tutorials, or edit your question asking these :) sorry, but you asked too much
tony cool
2007-07-10 04:11:00 UTC
code it yourself, that would be like $2000 min in programming


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...