How To Make An Authorization Form

Table of contents:

How To Make An Authorization Form
How To Make An Authorization Form

Video: How To Make An Authorization Form

Video: How To Make An Authorization Form
Video: How to write a authorization Letter! 2024, November
Anonim

Registration on the site is an optional function of the page. For a personal page on a social network or a website - business cards, it is quite possible to do without it. For an online store or site with a huge number of visitors, you need to create an authorization form.

How to make an authorization form
How to make an authorization form

Instructions

Step 1

Use a server mechanism that creates special sessions that store all sorts of information about the visitor while he walks through the pages of the site. It will notify the user about authorization. The next time you enter the browser, the server will create a new session, and the php script will either open access to the page for the authorized user, or will prompt other visitors to enter their login and password.

Step 2

To do this, create a page for data entry. Encode login forms in HTML. Add php-code to the beginning, it will control the correctness of the password and login entered by the user. Be sure to add the command "session_start ();", which will enable you to start a new session that has not yet been created for a specific visitor.

Step 3

Create a separate file containing only php code. It will connect to exactly the page that needs password protection. Name it "auth.php" (this is traditional for such files). Immediately after the php tag, place the "session_start ();" statement again.

Step 4

Connect the authorization block to all files stored on the server that need protection from unwanted users. It is necessary to insert the code at the beginning of each php-page.

Step 5

Use another method to create a form for authorization. Download a plugin (Hot login form, Fancybox, etc.) using the link of any developer's site, for example code.google.com. Write down the settings and style of the pop-up window for it. In order to initially hide the authorization block, enter the code.

Step 6

Install the plugin. Go to it to customize the appearance using CSS styles. Save the settings and check it works. If everything is done correctly, a small tab will appear at the top of the site, when you click on it, a window opens with fields for entering visitor data (login, password).

Recommended: