Tracking software usage
Tracking software usage
I am looking for a way to track software usage. For example, the total number of times a particular program is used each day.
Any ideas on how I would go about doing that?
Jason
Any ideas on how I would go about doing that?
Jason
Re: Tracking software usage
http://www.purebasic.fr/english/viewtopic.php?t=8624
No need to start a new thread. Search before posting, please. Thanks.
No need to start a new thread. Search before posting, please. Thanks.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
I read the other post and I am talking about something different. The program is going to be given away free to all who want it but I want to keep track of such things as how many times the application is used each day by all users, how many different users are using it, etc... For example if user 1 used it 3 times and user 2 used it 2 times that would result in a total usage of 5 times by 2 users.
I am thinking that having the application store the information on an internet database might be the best way to go. Now if I can find some tutorials on how to access internet databases.
Edit: If anyone else knows of a better way to do this other then use a database let me know.
Jason
I am thinking that having the application store the information on an internet database might be the best way to go. Now if I can find some tutorials on how to access internet databases.
Edit: If anyone else knows of a better way to do this other then use a database let me know.
Jason
- Joakim Christiansen
- Addict
- Posts: 2452
- Joined: Wed Dec 22, 2004 4:12 pm
- Location: Norway
- Contact:
I agree and it's also very easy to do if you know PHP and SQL. Then all you need is to to make your program contact that webscript each time it is run. Your program will not need to connect to any databases itself then (which would not be very safe either).jcoggins wrote:I am thinking that having the application store the information on an internet database might be the best way to go.
I like logic, hence I dislike humans but love computers.
google is your friendjcoggins wrote:Unfortunately I am not very familiar with PHP or MYSQL. Do you know of any good online tutorials that could walk me through it?
Jason
www.w3schools.com/PHP/DEfaULT.asP
www.php.net/tut.php
many more

cheers
- Joakim Christiansen
- Addict
- Posts: 2452
- Joined: Wed Dec 22, 2004 4:12 pm
- Location: Norway
- Contact:
This site is really good for learning anything web related:jcoggins wrote:Unfortunately I am not very familiar with PHP or MYSQL. Do you know of any good online tutorials that could walk me through it?
http://www.w3schools.com/PHP/php_intro.asp
http://www.w3schools.com/sql/sql_intro.asp
And to get you started I made this example for you (not tested, but probably works):
Code: Select all
<?php
//your webserver should have the needed information for you
mysql_connect('localhost','username','password') or die(mysql_error());
mysql_select_db('database_name') or die(mysql_error());
//Uncomment the line below to create your table or use phpMyAdmin
//mysql_query('CREATE TABLE counter (count int)') or die(mysql_error());
if (isset($_GET['countme']) and $_GET['countme'] == 'true') { //myWebsite/thisScript.php?countme=true
mysql_query('UPDATE counter SET count=count+1') or die(mysql_error());
} else { //or if you're there to check the count
$result = mysql_query('SELECT count FROM counter') or die(mysql_error());
if ($row = mysql_fetch_array($result)) {
echo 'Your program has been started '.$row['count'].' times.';
}
}
?>
I like logic, hence I dislike humans but love computers.
How do I get my program to contact the webscript each time it is run? Do I use a WebGadet or do I use some other method?Joakim Christiansen wrote:I agree and it's also very easy to do if you know PHP and SQL. Then all you need is to to make your program contact that webscript each time it is run. Your program will not need to connect to any databases itself then (which would not be very safe either).jcoggins wrote:I am thinking that having the application store the information on an internet database might be the best way to go.
Jason
- Joakim Christiansen
- Addict
- Posts: 2452
- Joined: Wed Dec 22, 2004 4:12 pm
- Location: Norway
- Contact:
I tried to cut this function down to just contacting the script and then disconnect (no download of the html). It depends on your server, but this might be enough to cause a valid visit so your counter will count it.jcoggins wrote:How do I get my program to contact the webscript each time it is run? Do I use a WebGadet or do I use some other method?
Code: Select all
Procedure.s HttpGet(Server$,Path$) ;simple one to make page count a hit
Protected Request$, ServerID = OpenNetworkConnection(Server$,80)
If ServerID
Request$ = "GET "+Path$+" HTTP/1.1"+#CRLF$
Request$ + "Host: "+Server$+#CRLF$+#CRLF$
SendNetworkData(ServerID,@Request$,Len(Request$))
CloseNetworkConnection(ServerID)
Else
Debug "Error connecting"
ProcedureReturn Result$
EndProcedure
HttpGet("myWebsever.com","/theCountScript.php?countme=true")

I like logic, hence I dislike humans but love computers.