Hello everybody,,i am completly new in php(i'm a java;) programmer)and i need a help for creating a counter, i have a pdf file on the server and if someone has a counter that does the following:
-when someone clicks on the pdf file ,the counter stores the clicks times value in a txt file,,
<a href=simple.pdf>click here</a>

so i can read that txt file with my java program to show the clicks times
-----------------
i found many hit counters but the problem is how can i make them just for the pdf file
---------
i will post that java program when i'm finished form it:) ..

thanx for your help..

Recommended Answers

All 2 Replies

The only way that I know of to fire a php file is to open it, generally with a browser. If you go directly to a .pdf file, I have no idea how a php script will be able to detect this action. You could create a php file and serve the .pdf file from that php file. You will find some examples on doing that here:
http://us2.php.net/header

as far as writing to a text file:
http://us2.php.net/manual/en/function.fwrite.php

thnx R0bb0b for your help as u said: to open the pdf within the browser,,that's a good idea i'm trying to do it now,,and i found a good hit counter http://www.stevedawson.com/article0007.php


thank you again..
nemom

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.