How To Enter Registration On Your Site

Table of contents:

How To Enter Registration On Your Site
How To Enter Registration On Your Site

Video: How To Enter Registration On Your Site

Video: How To Enter Registration On Your Site
Video: How to Allow User Registration on Your WordPress Site 2024, December
Anonim

The registration process is already firmly established in the lives of Internet users and is well known to them. However, novice webmasters do not always have the necessary knowledge to install such a familiar registration module on their own resource.

How to enter registration on your site
How to enter registration on your site

Instructions

Step 1

First, install the Apache server on your computer. Then create files like this on your site:

1) index.php - main page;

2) reg.php - registration page;

3) auth.php - authorization;

4) userdb.db - list of registered users.

Step 2

Designate the structure of the user base with parameters login (name), pass (codeword or password), role (access level), name (name), info (information). For each user, a separate string of the form user1% 1-1% user_pas% 1-1% user_role% 1-1% user_name% 1-1% user_info will be created.

Step 3

Create forms for registration and authorization. An example of an authorization form:

Step 4

The content of the auth.php file consists of the usual form, lines

Registration and other data, more detailed information about which can be found on specialized programming sites.

Step 5

Next, write the registration form - a script. Below is a part of the script:

$ fp1 = file ("userdb.d");

foreach ($ fp1 as $ key => $ value) {

$ user = exploode ("0-1%", $ value);

if ($ _ POST ['login'] == $ user ['1'] and md5 ($ POST ['pass']) == $ user ['2']) {

$ us = 0; ech "Such a user already exists in the database";}

if ($ us! = 1) {$ fp = fopen ("userdb.d", "a +");

$ mytext = preg_replace ("! / r / n!","

", $ _POST ['login']."% 1-1% ". Md5 $ _POS.

Step 6

Connect all created pages to index.php. An example of what should turn out:

<

Step 7

After carrying out the above manipulations, proceed to testing the registration system. If everything went well, new records will appear in the created database - registered accounts.

Recommended: