PHP implements the login registration BootStrap form function, and login registration bootstrap

Source: Internet
Author: User
Tags free cdn

PHP implements the login registration BootStrap form function, and login registration bootstrap

Preface

The previous articles briefly introduced some knowledge points of front-end and PHP. Form submission in front-end is a very important module. In this article, I will introduce some knowledge about forms, if you are not familiar with the previous content and do not have a lot of exercises, I feel you 'd better write down the labels first.

Project Overview

Login and registration are the most common modules in web development, and they are also frequently used in our daily life. The user enters the content on the front-end form page and submits the content to the background through POST. After the PHP code processes the submitted content, the user continues to operate on the login or registration logic.

Logon and registration illustration

BootStrap front-end framework [http://v3.bootcss.com/]

Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive la S and mobile device-preferred WEB projects.

How to use BootStrap? We can download its source code to a local device, or use the free CDN acceleration service provided by BootCDN.

First, we will build the basic skeleton of the page.

Then click Start to find the following content:

Copy the CSS file in the Red Circle to our page

<Html> 

BootStrap gives many cases where there is a login page for the case http://v3.bootcss.com/examples/signin/

Let's copy this page.

<Html> 

Here, <style> </style> contains CSS. If you have any doubts, you can check them one by one on Baidu, or you can leave CSS empty first, then add the CSS code to check the effect. Let's analyze the form in HTML.

• Form label ==> is used to wrap the form content and is also the initial label of the form.

• In the form tag attribute action => action = "xxx", enter the address of the file where the PHP code for processing the form is located. Click the submit button and the form will send the data to the address.

• The method label attribute is not easy to understand. You just need to fill in post when submitting the form. method = "post" can be checked by Baidu if you are interested.

• Input tag ==> if you are careful, you can see that input exists individually. The <input> tag specifies the input fields in which users can enter data. The <input> element is used in the <form> element to declare the input control that allows the user to input data.

The input field can be changed in multiple ways, depending on the type attribute. Common type attributes include text, email, password, checkbox, radio, button, submit, and hidden. You can try to change the type to see the effect.

• The property name of the input tag ==> THIS name value is crucial, the reason why PHP code in the background can tell which input box each value comes from is determined by name = "xx.

• Input tag attribute required ==> if the user does not write anything, can we allow them to submit the form? Obviously, this is not acceptable. Therefore, we need to ask the user to fill in the content before submitting. required means that the form will not be submitted if the user does not fill in the content and click Submit.

Summary

The above section describes how to implement the BootStrap form function for login registration in PHP. I hope it will be helpful to you. If you have any questions, please leave a message. The editor will reply to you in time!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.