2
And guys I have a JS that has some functions that takes the name of the player, position, position, level, image etc. I want to save this data in a dB, the user logs in with the account and access the data with a JS, to view the information.
Can I do this with a JS and php?
Or I can write to a txt, and capture with JS in the BD folder of the site host.
There is how to create a txt com on the site host with pure JS for example creates writes le and erases data in txt with JS.
Just to be clear: do you want to do this on the server ("site host") or on the client ("site guest")? Carlos' answer seems to me to be a solution on the client side (and exclusive of IE, if I’m not mistaken), others would use local Storage or Indexeddb... A server-side solution would require a platform of its own (whether PHP or any other language, including Javascript - Node.js). Related: "Browser storage"
– mgibsonbr
Wanted to use on the server where could only edit the file with login.
– adailton moraes
In my opinion this is a very broad subject to be addressed in a single question (because it involves programming on the server side, logging in, saving data, restricting access). I suggest we start with some PHP tutorials (or another platform, depending on what your server supports), they will certainly cover a lot of your questions. Also read on AJAX (because it seems to me that you are trying to make a kind of game, so you must need this - or websockets, but then it is already more complicated).
– mgibsonbr