You do not say which technologies you are using, so it is almost impossible to answer your question in a meaningful way.
Here[
^] is an elementary tutorial using PHP and MySql. If your needs are different to that then use a search engine to search on something like
website login.