This really should be in programming help...
There are a few ways you can do this.
The simplest would be to use .htaccess and .htpasswrd files in the directory you want to make for members only.
When trying to open a file in this directory, the user is presented with a a user login screen and preventing access on failure.
This however looks naff!!!
The best way would be to use a server-side script, like php to manage information to/from a database of users.
However, you will have to learn to program in php as its not particularly simple!!!
I have built one on my site, with registration, encryption and page validation processes.