-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?

4
  • how are you planning to recird the specific number? Commented Oct 3, 2016 at 4:50
  • Assuming it needs to work for many users Node.JS can, either way some language server-side will be needed. Commented Oct 3, 2016 at 4:51
  • Possible duplicate of Javascript save data to file system (with user prompt) Commented Oct 3, 2016 at 4:52
  • "Local .txt File on the server" What is that? Commented Oct 3, 2016 at 4:58

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

You want to use localStorage, sessionStorage will be gone once the browser is closed.
@SpencerWieczorek - Thank you
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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.