Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
WEB: Web Design Forum- TutorialsDreamweaver Forum- TutorialsFlash Forum- TutorialsWeb StreamingTraining

Retreiving Stats from site

Cow Forums : Adobe Dreamweaver
Retreiving Stats from site
by Jacob Resendez (jacobean) on May 23, 2008 at 5:54:24 pm

i have an online commerce site that was built in html pages. one of my pages has a link where my visitors will be able to download a product for free. i can tell how many people visited the page by looking in my admin stats, but i would like to know if i can see how many downloads have occured. to download the product, visitors simply click on a link and a download prompt box appears. any ideas/suggestions/solutions would be greatly appreciated.
thanks

Respond to this post   •   Return to posts index

Re: Retreiving Stats from site
by Abraham Chaffin on May 23, 2008 at 6:23:30 pm

You could use a modified version of the hit counter in this post:

http://forums.creativecow.net/thread/191/855970#855975

Only at the end of the end of the file do a redirect to the file you want them to download using this code (replace http://www.creativecow.net with the location of your file:



header("Location: http://www.creativecow.net"); exit;




Full thing would look like this:


<?
$filename='mycounter.txt';
if(!is_file($filename)){
file_put_contents($filename,'1');
}
$count=file_get_contents($filename);
$count++;
file_put_contents($filename,$count);

header("Location: http://www.creativecow.net"); exit;
?>



The only other way to do this is if you have direct access to the server log files or a program is installed that does then you could track it from that program. Ask your ISP about such a program.

Abraham

Respond to this post   •   Return to posts index

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>


FORUMSTUTORIALSMAGAZINEDVDsBOOKSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]