If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Generating Sequential Numbers onpress behavior

I am curious how to create an onpress or onclick behavior that generates a sequential number string until I reset the counter. I have a beginning knowledge, use image maps and need a little help creating the code. I would like the sequential numbers generated all sent to a log file that I can then use in a couple desired ways, but primarily to get a total +/- count on items at the end of the work day. The working field example is: Im wanting to be able to pull up my specific webpage on my tablet and push a +button and a -button that will then send the sequential number count from there to a file for viewing. Ive explored click trackers but I dont think its the right solution. Thanks for the help! Need more info or have ?s, please ask.

You cannot do this in html, however you can use a server side scripting language like perl or php to do this.

What you will need to do is on forum submission you use your script to first read the log file, parse it to an integer, add one, then printing it on the log file. To avoid a infinite 1234567.. and so forth, just create a separate text file for your script to access and overwrite. Or continuing to append to a log for a count would be extremely annoying.

Thanks for the info. Ill have to become familiar with server side script. Is one better then the other? (perl / php) And I wonder now if storing this on a database wouldnt be the best solution. Could you explain how the database solution gets constructed?

Perl is my choice, so I'll give you a example in it.
To do this, call a javascript function to occur onClick, and then pass. Your perl script will then connect to your database (mysql, postgre, etc..) and SELECT the exisiting integer. Then simply do math of integer+1, INSERT the new integer back into the database.