I want to implement a simple script which is hosted in a web server when called by a desktop application increments the value stored in simple text file or simple database.
I want to protect the counter with a password so that only my application can activate the script and increment the value.Please Help me out
How can i do this i have got the basic code for a counter
<?php
2 $counter = ("hitcounter.txt");
3 $hits = file($counter);
4 $hits[0]++;
5 $fp = fopen($counter , "w");
6 fputs($fp , "$hits[0]");
7 fclose($fp);
8 // echo $hits[0];
9 ?>
You can use basic HTTP authentication on php.
Example from php.net