dcsimg
www.webdeveloper.com
Results 1 to 5 of 5

Thread: Generating Sequential Numbers onpress behavior

  1. #1
    Join Date
    May 2013
    Posts
    3

    Post 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.

  2. #2
    Join Date
    Jul 2012
    Posts
    57
    Hello,

    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.

    The other option is to store it in a database

  3. #3
    Join Date
    May 2013
    Posts
    3
    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?

  4. #4
    Join Date
    Jul 2012
    Posts
    57
    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.

  5. #5
    Join Date
    Feb 2013
    Location
    USA
    Posts
    40
    Thanks for these information, its very helpfull.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles