-3

I have made a simple site that generates random number. I want to record how many times a specific number comes up.

Is there anyway I can use javascript to write to a Local .txt File on the server?

or do I have to learn PHP?

Nnoka
  • 15
  • 3
  • how are you planning to recird the specific number? – brk Oct 03 '16 at 04:50
  • Assuming it needs to work for many users [Node.JS](https://nodejs.org/en/) can, either way some language server-side will be needed. – Spencer Wieczorek Oct 03 '16 at 04:51
  • Possible duplicate of [Javascript save data to file system (with user prompt)](http://stackoverflow.com/questions/15212240/javascript-save-data-to-file-system-with-user-prompt) – Cine Oct 03 '16 at 04:52
  • "_Local .txt File on the server_" What is that? – Teemu Oct 03 '16 at 04:58

2 Answers2

1

If you want to keep track of the number of times a random number comes up for a single client/browser, you can use localStorage. If you want to keep track of the number of times the random number occurs across all executions, you'll need some sort of server-side processing.

user2182349
  • 9,569
  • 3
  • 29
  • 41
0

If you want to avoid any server side processing and this data is critical then you can try GoogleAnalytics code to capture and analyaze the randomly generated data.

Sagar Shirke
  • 648
  • 9
  • 32