I am creating a website.It is not a wordpress website.I want to create username and Password for the Users who visit my site .to get Register.
Whether I should use Database for this?
or the Accounts provided by the Web-server?.I don’t have any knowledge regarding that.
Moreover how should I show a different page for each user showing his name and Profile stuff when he login successfully
I know that need PHp but how.?
I searched over the internet bu didn’t find anything helpful
I am creating a website.It is not a wordpress website.I want to create username
Share
You should definitely use a database for this. There are a number of php libraries and frameworks that offer this kind of functionality, look at this question Role Based Access Control for some helpful pointers.
There are numerous tutorials on the web that show you how these mechanisms work, and of course there are the sample pages of the different libraries referred to in the answers of the SO question.
A complete example that can help you understand the entire mechanism can be found here, with an extended version here.
For storage, aside from a database you could use files. Linux for example typically uses files to store user credentials (
/etc/passwdfor identifying data,/etc/shadowfor passwords andetc/groupsfor user group info). It’s harder to do right than a database though – concurrent write access needs to be managed, you have to secure the files against downloading, etc.There is one constant though, for both files and databases: never ever store passwords in plaintext, but use a “salted hash“. That way, if your system ever gets cracked at least your user’s passwords will be safe.