How to override login.phtml template in Magento 2?

You can override login.phtml file using layout XML way or directly add template file to the theme level under Magento_Customer theme module.

login.phtml file used to display login form in Frontend area.

Theme Level Override,

app/design/frontend/<ThemePackage>/themename/Magento_Customer/templates/form/login.phtml

Module Level Override,

You can see a base definition for define login.phtml file at customer module, Magento_Customer/view/frontend/layout/customer_account_login.xml location.

How to override form/register.phtml template in Magento 2?

You can override register.phtml file using layout XML way or directly add template file to theme level by theme module.

register.phtml file used to display a Customer registration form in frontend.

Block name is customer_form_register which contains the register.phtml template.

you can see registration form by URL, <SITE_URL>/customer/account/create

Get Website code by store id programmatically magento 2.

Magento 2, You can fetch website code by just passing store id value.

You required store id to get website code from the passed store id.

You can fetch website code using the below code snippet,