1

I have found some code to make a counter in php (simple, without using a database). The counter is implemented with some small php code that triggers when click_installer becomes yes. I need to put this code into a href (according to the original code), but I also need a href for the link to go to. How can I combine two href statements in one href so both the counter and link works. What I now have is:

 <h3><a   href="?click_installer=yes" href="http://pcgtools.mkspace.nl/PcgTools.zip" 
  >PCG Tools 1.8.1 Installer (.zip)</a></h3>

In this solution, only the first href works, so the counter is updated.

If I switch the href commands like:

 <h3><a href="http://pcgtools.mkspace.nl/PcgTools.zip" href="?click_installer=yes" 
   >PCG Tools 1.8.1 Installer (.zip)</a></h3>

only the link will work and the counter will not.

1 Answer 1

1

Either:

  1. Link to your script. Issue a Location header to redirect to the other file.
  2. Fetch the counter URL using JavaScript, then let the href be followed
  3. Forget about writing code to store a count. You've got a webserver, just examine the server log files.
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for the answer, but I'm a total noob regarding php, I think I need some more info, espeically regarding 1 and 2. I don't see why a file is not good ... I don't use a webserver.
duckduckgo.com/?q=location+header+php - but you're going to run running a website using PHP very hard without a webserver.
It seems to work ... except that I need to refresh the screen to see the count update, but thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.