Well, I am making a advetising program, and when the people either click the text link, or the image, I want that <a href="...">...</a> code to add clicks into a txt file. Like say the link already has 14 clicks, and someone clicks the text link, than it would display it has 15 clicks, and so on and so on...
For the clicks i would have it show in the link like google.com?id=15
and have the clicks go into a database or if you want text file that you have. If someone types in google.com?id=1000 it wil automatically know that the next one is 16 so it redirects it to google.com?id=16.
Say I have a text file, and I have on the text file "12" already in there. Alright, now that I have the on there, say I have a link to google.com on my page, and I would like it to link to google.com. What would I make the link?
You would need to make the link, a link to your script, with the URL that you want to go to, a parameter, so it knows where to go.
Example of how this would work:
1. Make a link like say: <a href='link.php?url=http://www.google.com'>Google</a>
2. In link.php, you can run the script to increment the counter. Then, at the end, you can use a redirect, to send the people to Google.
So whats actually happening is that your not linking to Google, but to the script, and then the script sends them to Google. The url paramter can be any URL. Every link you want to be counted then, you would link to link.php?url=<URL Here>. Get it?
Alright, that explains a lot! But, just one more question...
You said to use link.php as the script to increment the counter. But, would that be the link to the actual txt file, or would that be a link to the file that actaully does the adding to the text file? Like, the PHP file that does the adding to the txt file.