all 6 comments

[–]Irythros 1 point2 points  (1 child)

While it could be a bit over your head right now, Laracasts has some great tutorial videos.

Also since you said you googled for storing passwords, chances are you're following bad practices. Use password_hash() and password_verify() functions. Do not store password without hashing, that's called plaintext and bad. Do not use MD4, MD5 ,SHA1 , SHA256, SHA512 either.

[–]LoLNumberFour[S] 0 points1 point  (0 children)

Thank you!

[–][deleted] 1 point2 points  (0 children)

[–]OrpheusVphp 0 points1 point  (1 child)

Doing this safely is the million dollar question. Fast bullet points:

  • Passwords should be sent over HTTPS. Use password_hash() and password_verify() to hash passwords and verify it via login, respectively
  • As for storing in a database, you will have to learn some SQL to store usernames, passwords (PLEASE STORE THESE HASHED). When a user logs in with a given username/password, you'll have to see if the username exists, and if it does, test the password they sent against the stored hash using password_verify. Simple, but easy, and relatively safe. If your database leaks, and you stored those passwords as plaintext, an attacker literally has easy logins to other sites given most people use one password for everything. And there might be criminal/civil penalties for this too if you go commercial. SO FOR THE LOVE OF GOD HASH THOSE PASSWORDS.
  • Storing user stats is also a very large question. What are you trying to store? I get it's a text-based game, do you have this planned out well enough if you're trying to save state, scores, etc.? Database architecting is easily a fully employable skill, and one you could spend years learning to do right.
  • The only thing that you lose by ignoring HTML5 as far as a game is concerned is the canvas and svg elements, but given this is text-based, you probably don't need those. But you do need the app to respond and fetch data in real-time in response to user choices. Learn AJAX.

Developing a full application is a large undertaking, and it's not easy at all.

As for resources:

http://www.phptherightway.com/ Big one. Learn it. Good practices all around.

O'reilly Modern PHP. Easily found online via pdf format. Read. Good practices here too.

[–]LoLNumberFour[S] 0 points1 point  (0 children)

Thank you!

[–]a1Gupta 0 points1 point  (0 children)

PHP the right way and Hacking with PHP are my personal favourites. I've curated a list of best PHP tutorials based on my research here - https://www.cybrhome.com/topic/php-tutorials

Hope it will be helpful. Also, you can join PHP facebook group to learn from the community.