Need help whit login page

Im trying to make a login page for admin and user login but having problem whit geting the code correct. And i allsow want it to display in a userpage so they can change there info later like name and email.

I have looked and looked on youtube, google but i cant find out how to do it correctly.

I have allsow made so people can register, but i cant get the validation mail to be sent.

Someone that know how to?

I used this article to wrap the idea of authentication, hope you find it useful as much as I did