Форма входа и регистрации с помощью HTML5 и CSS3. HTML-формы
Share
Have you minutely ever followed the login page that appears when you sign up for a particular website? The first page that comes up whenever you are logging in is the first impression of a website. The design of the login form will itself define the nature of the website and hence it should carry pertinence with the website it is leading to.
Truly, login or signup forms are one of the most important elements that a web page contains and hence designing these online forms is one of the most significant features when it comes to designing the website. A successfully created sign up form also encourages as well as allows the visitors to becoming a member, a subscriber or a customer for a particular business. A sober-looking, creative as well as visually attractive signup form will surely encourage a fruitful rate of conversion of a visitor if all the other features are properly coordinated.
Designing an effective as well as clean login/signup form asks for a lot of creativity from the designer as it is important for a website to have an appealing & outstanding form for the sake of its success and efficacy.
Some highly effective and attractive login form designs
There are some registration forms which consist of basic that are created with the help of some elementary web designing concepts. Apart from these elementary ones, there are few which may look a bit different o some extent. However, there are some others which are extremely impressive as well as creative that categorically lures the visitor to enter the website.
Some of these forms have an option of entering personal contact information in details and they include the name, e-mail, contact number and other things . The styles of these forms go much beyond ordinary, and some of them even have come up with an option of handwritten calligraphy.
Few login pages come up with various innovative input style of text beside some highly innovative option or select menus. These types of forms really ask for a high level of creativity from the designers, especially when it comes to designing the space in between various layers, creating texts that are large and easily readable, and creating the sidebar links that connect to their e-mails directly.
A specific type of form provides a dramatic insight of a new data input field. The users have the leverage of getting to the login link from the homepage itself and call up a login box powered by jQuery. This particular type of form comes up with an Ajax that it uses to direct an external script of PHP. It evaluates the information that a user has used in logging in and once processed, it either grants the permission to the user or denies it.
A number of login form designs that we see these days are indeed extremely dynamic and consist of some of the very latest designs. One of these new age designs provides a wonderful insight into the various data input fields. Users can easily go to the homepage and can click the link on the login page to call up a dynamic login box powered by jQuery. This particular login form comes up with the option of linking an external PHP script that helps in evaluation of various login information and depending upon the outcome of the result; it either allows entry of the user or denies it.
Login Form Examples
Login Form from Impressionist UI by Designmodo
Although, at first sight, it seems that inputs slightly soar in the air, since gradients and vector realization placed on a textured canvas leads to a slight balanced in harmony. Nevertheless, this tooltip-inspired basic login form looks interesting and unique.
Login by Haziq Mir
The designer places fields in line, making the overall component suitable for standard relatively narrow headers. While soft, warm brownish coloring paired with inner shadows give each item pleasant, smooth and finished appearance, the dark version has a more sophisticated look.
Stellar Login, Improved by Haziq Mir
The first thing that catches the eye is a background that can become an excellent complement to any intricate or illustrative design, where natural textures such as wood or paper run the show. While sleek inputs and grayish coloring ideally suit to the notebook-styled canvas, the huge blue ‘Sign In’ button grabs the whole attention with its great visual weight.
Login Form by Sergey Shmidt
This is an excellent example of a dark login form that exudes an image of sophistication without being brutal. The glossy brown button instantly strikes the eye, calling to action. Tiny metallic toggle adds a lovely skeuomorphic flair to the composition.
Login form for personal application by Ionut Zamfir
The backdrop of the form mimics a common notebook surface where we usually make notes. Wooden canvas enhances the overall aesthetics. Although shiny gradient buttons slightly break away from the theme, here flat or sketchy buttons might look more natural, yet still the component achieves a sense of harmony.
Sign In Widget
The designer exhibits a subtle and elegant web form, the wow factor of which is produced by its semi-transparent background. It has an optimal contrast that sets apart lettering and icons from the backdrop, and as usual, massive almost overwhelming bulging CTA.
iPhone App Login Form
iPhone App Login Form by Mason Yarnell is executed in the best traditions of iOS designs of previous years. There are lots of glossy stuff, ornamental ribbons, embossed icons and, of course, complicated textured backdrop. Nevertheless, in general, the component looks clean, fresh and with lots of air.
Light login by Maxwell Barvian
Light login by Maxwell Barvian looks exactly as stated on the nameplate: light, clean and crisp. Grey and white colors together can do wonders easily providing users with an excellent experience. As befits, for better conversions, the main button is intentionally oversized and is painted in a bright tone.
How to Create Login Form with CSS3 and jQuery
It is a small tutorial that is subservient even to novice web developers. Although the design is quite simple and input fields at first look like buttons because of a gradient styling; however, it is a representative example of sleek and well-structured web form that can come in handy in numerous UIs.
Login by Paresh Khatri
Some login by Paresh Khatri is a tiny web component that boasts of a vibrant color scheme and meticulous attention to details. The tooltip-inspired shape, circular photo thumbnail, inset treatment, semi-transparent backdrop make this design easily stand out from the crowd.
App Login
Carefully laying out each element of the form one above the other, Mynus is managed to tie the design together and ditch the backdrop that would only distract attention from a refined screen. The coloring, edges, shapes, rounded corners, typography, amount of white space and embossed touches make the design unique and crisp.
Dark login by Adam Whitcroft
Dark login by Adam Whitcroft looks sophisticated and top-notch. An excellent choice of font in tandem with contrasting colors offers users an optimal readability. ‘Sign In’ button, grayish glyphs and switch look a bit seamless, yet they ideally blend in the environment.
User login
User login has a warm creamy coloring that evokes positive feelings. Orange and blue are used as decorative touches that add a zest and make the form suitable for various designs. Gradient-based CTA with a convex appearance simply jumps at you, inviting to action.
Snappy Login by Charlie Waite
Snappy Login by Charlie Waite is an interesting take on a web form that has a simple yet original appearance mainly thanks to flat transparent inputs. Although text inside fields experiences some illegibility, when the backdrop is too washy, yet on the whole, it certainly has a charm. The decorative font and embossed button look exceptional, and as it should be, an attention-grabbing.
Sazzi Login by Ionut Zamfir
Sazzi Login by Ionut Zamfir features a nice twist produced by the CTA buttons. The primary coloring is neatly selected, and the accent tone perfectly complements the overall aesthetics. The form looks great on a monotone or noisy canvases, especially input fields that seem to be naturally inbuilt.
Notepad Login final by Haziq Mir
Notepad Login final by Haziq Mir is another illustrative take on a common minimalistic form in our collection that is planned down to the last detail. The background holds the theme together, original dashed-styled fields and elegant cursive typography have artistic flair.
Stacked Paper login by Patrik Larsson
The author goes for a more traditional route by using clean backdrop, standard boxes for inputs, regular type, and calm color palette. Here red is used for accent, giving the CTA a striking appearance. Tiny details as a metallic clip as well as wooden texture just enrich the aesthetics.
This is in continuation of the tutorial on making a membership based web site. Please see the previous page for more details.
Download the code
You can download the whole source code for the registration/login system from the link below:
The ReadMe.txt file in the download contains detailed instructions.
The login form
Here is the HTML code for the login form.
Logging in
We verify the username and the password we received and then look up those in the database. Here is the code:
function Login() { if(empty($_POST["username"])) { $this->HandleError("UserName is empty!"); return false; } if(empty($_POST["password"])) { $this->HandleError("Password is empty!"); return false; } $username = trim($_POST["username"]); $password = trim($_POST["password"]); if(!$this->CheckLoginInDB($username,$password)) { return false; } session_start(); $_SESSION[$this->GetLoginSessionVar()] = $username; return true; }
In order to identify a user as authorized, we are going to check the database for his combination of username/password, and if a correct combination was entered, we set a session variable.
Here is the code to look up the username and password.
function CheckLoginInDB($username,$password) { if(!$this->DBLogin()) { $this->HandleError("Database login failed!"); return false; } $username = $this->SanitizeForSQL($username); $pwdmd5 = md5($password); $qry = "Select name, email from $this->tablename ". " where username="$username" and password="$pwdmd5" ". " and confirmcode="y""; $result = mysql_query($qry,$this->connection); if(!$result || mysql_num_rows($result) <= 0) { $this->HandleError("Error logging in. ". "The username or password does not match"); return false; } return true; }
Please notice that we must compare the value for the password from the database with the MD5 encrypted value of the password entered by the user. If the query returns a result, we set an “authorized” session variable, and then redirect to the protected content. If there are no rows with the entered data, we just redirect the user to the login form again.
Access controlled pages
For those pages that can only be accessed by registered members, we need to put a check on the top of the page.
Notice that we are setting an “authorized” session variable in the login code above. On top of pages we want to protect, we check for that session variable. If user is authorized, we show him the protected content, otherwise we direct him to the login form.
Include this sample piece of code on top of your protected pages:
CheckLogin()) { $fgmembersite->RedirectToURL("login.php"); exit; } ?>
See the file: access-controlled.php in the downloaded code for an example.
Here is the CheckLogin() function code.
function CheckLogin() { session_start(); $sessionvar = $this->GetLoginSessionVar(); if(empty($_SESSION[$sessionvar])) { return false; } return true; }
These are the basics of creating a membership site. Now that you have the basic knowledge, you can experiment with it and add new features, such as a “Forgot password” page to allow the user to retrieve or change his password if he forgets it.
Updates
9th Jan 2012
Reset Password/Change Password features are added.
The code is now shared at GitHub .
License
The code is shared under LGPL license. You can freely use it on commercial or non-commercial websites.
No related posts.
Comments on this entry are closed.
Online Signup and registration forms, are important aspects of almost every web design. If your website needs active contribution from the visitors, then you should have provisions so that they can register or signup to open an account with your site. Users register with a site to download files or post articles, to purchase something & son depending on the theme of a site. The registration forms, are pretty elaborate, asking for a wide range of personal and contact details from the users- like age, name, gender, job, brief biography and so on. But the most important aspect of all HTML5 Signup & Registration Forms are name, username, password, gender and account creation button.
XtraForm – Bootstrap 3 Xtra Animated Form HTML5 Format
This bootstrap registration form template is coded based on jQuery mobile JavaScript which makes it compatible across many platforms and also make it very customizable. The html5 form template is available for free download here.
Multi-Step Signup Form With CSS3 and jQuery
This kind of registration form in html with CSS3 helps in sectioning of various parts of a long sign up form, thus making it easy to maintain records whereas jQuery ensures that these forms can work on a wide number of platforms. Download the sign up page template from here to build a form for your own site today.
Authentix – Ready to Integrate User System HTML Format
This kind of html5 form template is created by simple PHP script for signing up, logging in or authenticating users. This kind of login and registration form templates can also provide the feature of secure sessions. Download one from here to implement one of these in your own site.
This kind of registration form template uses CSS for registration form and is very helpful in creating sign up forms meant for the android platform. This kind of html registration form template is available for download below.
Codepen Sign Up Form in HTML Format Download
With its revamped fresh design and very simple interface, this kind of html5 form templates have been carefully optimized for creating new user registration forms. With its utility in various fields, these signup form templates are really handy and can be downloaded right from the link below.
Formplexy – CSS Forms with Validation & WP Support HTML Format
This kind of html registration form is very neat and customizable for any developer. It is extremely fast due to CSS form with jQuery. It also has WordPress support, social buttons and an option of forgotten password handling. Download the form from here to use it in your own site.
Download Login & Registration Form with HTML5
This kind of registration form template is used for login and signup due to the fact that it is very simple and uses very simple coding. This kind of html5 form templates find a wide number of uses due to their light structure and can be downloaded right from here.
Tab Login & Sign Up Forms HTML Download
This kind of signup form templates are widely used due to their tab oriented look which is very helpful in categorizing thing. This type of html5 form templates can be downloaded here to be used for long sign up forms with many fields for taking information.
Signup Form Flat Template Download
With its minimalistic look , this kind of registration form template is widely used due to their simple and clean look and due to the fact that this kind of html5 signup template can work on many platforms. You can get one of these forms here for download.
Flat Look HTML5 & CSS3 Signup Form Template Free Download
Equipped with the simplicity and cleanliness of an html5 coding coupled up with the security of a CSS3 signup security with jQuery, this kind of signup form template is one of the best options you can find for your site. Want to know how will it look for your site? Just quickly download it from the link below to check it out.
How to Create Registration Page?
A registration page on a website consists of registration form that lets website users to get registered with the website and get access to applicable facilities, services or products. A registration page is considered to be the most important aspect of a website as it gives you a way to be more interactive with your users. For creating a registration page, first you just need to add a new page through your CMS and then add the and registration form to it. You can find a large number of registration form templates online for easy and quick installation on to your page.
Awesome Design HTML5 and CSS3 Login & Sign Up Forms
This HTML5 and CSS3 login and signup form comes with an awesome design with perfectly sectioned fields. The form is handy and easy to install. Just download the form and you can customize it as per your preferences.
Simple, Highly Functional and Effective HTML5 Register Form
HTML5 based registration form ideal for all kinds of website like college, medical, shopping, school and even more. Comes with an optimized design to provide best call to action to a website user.Registration and Login form templates online that you can hardly create yourself. The best part with these templates is that along with their standard use, you can customize the fields, size as well as color of the form elements quite easily in minutes. Whether you need a student registration form, ecommerce registration form, event registration form or more, you can find template forms for all kinds of your sign-up form needs. There are numerous such registration and login templates that offer you a secure, effortless and elegant forms to be added to your websites. You just need to get these downloaded in a few clicks and do minor customizations is necessary.
Формы предназначены для пересылки данных от пользователя к веб-серверу. Формы в HTML могут состоять из текстовых полей и текстовых областей, флажков и переключателей, а также раскрывающихся списков. Все это — элементы формы. Каждый элемент служит для того, чтобы передать какое-либо значение сайту.
По своей сути HTML-форма — это веб-страница на которой вы видите области для ввода своей информации. После того, как вы заполните форму и нажмете кнопку отправить, информация из формы упаковывается и отсылается веб-серверу для обработки серверным сценарием (файлом-обработчиком). После обработки к вам возвращается в качестве ответа другая веб-страница. Следующий рисунок наглядно демонстрирует как работает форма:
Нет ничего сложного в создании HTML-форм. Самый простой способ получить представление о формах — это разобрать небольшой HTML-код, а затем посмотреть, как он работает. В следующем примере показан синтаксис создания простой HTML-формы:
Пример: Простая HTML-форма
- Попробуй сам »
Моя первая форма:
Имя:
Фамилия:
Элемент
Формы вставляются на веб-страницы посредством элемента
. Он представляет собой контейнер для всего содержимого формы, включая такие элементы, как текстовые поля и кнопки, а также любые другие теги языка HTML. Однако он не может содержать в себе другой элемент
.
Для отправки формы на сервер используется кнопка «Submit», того же результат получится, если нажать клавишу «Enter» в пределах формы. Если кнопка «Submit» отсутствует в форме, клавиша «Enter» может быть использована для отправки.
Большинство атрибутов элемента
влияют на обработку формы, а не на ее дизайн. Наиболее распространёнными из которых являются action
и method
. Атрибут action
содержит URL, на который информация в форме будет отправлена для обработки сервером. Атрибут method
является методом HTTP, который должны использовать браузеры для отправки данных формы.
Элемент
Практически все поля для формы создается с помощью элемента (от англ. input — ввод). Внешний вид элемента меняются в зависимости от значения его атрибута type :
Вот некоторые значения атрибута type :
Ввод текста и пароля
Одним из самых простых типов элементов формы является текстовое поле, предназначенное для ввода текста из одной строки. Данный тип ввода текста установлен по умолчанию, а следовательно, именно однострочное поле отобразится, если вы забудете указать атрибут type . Для добавления однострочного поля ввода текста в форму следует внутри элемента прописать атрибут type со значением text:
Поле ввода пароля является разновидностью обычного текстового поля. Оно поддерживает те же атрибуты, что и однострочное текстовое поле. Атрибут name устанавливает имя поля ввода пароля, которое будет отправлено на сервер вместе с паролем, введенным пользователем. Чтобы создать поле для ввода пароля, необходимо задать значение password атрибуту type (password (англ.) — пароль):
Пример создания формы с полем для ввода пароля:
Пример: Поле ввода пароля
- Попробуй сам »
Ваш логин:
Пароль:
Вместе с этим атрибутом можно использовать атрибут maxlenght
, значение которого определяет максимальное количество символов, которые можно ввести в данную строку. Можно также задать длину поля ввода, используя атрибут size
. По умолчанию, в большинстве браузеров ширина текстового поля ограничена 20 символами. Для управления шириной элементов новых форм, вместо атрибута size
, рекомендуется использовать средства каскадных таблиц стилей (CSS).
Атрибут value
задает значение, которое по умолчанию отображается в текстовом поле в момент загрузки формы. Введя в поле значение по умолчанию, можно пояснить пользователю, какие именно данные и в каком формате вы хотите, чтобы пользователь сюда занес. Это как образец, ведь пользователю гораздо удобнее заполнять форму, видя перед собой пример.
Переключатели (radio)
Элемент типа radio создает переключатели, которые используют принцип логического «ИЛИ», позволяя выбрать только одно из нескольких значений: если вы выбираете одно положение, то все остальные становятся неактивными. Основной синтаксис элемента-переключателя:
Атрибут name
для переключателей обязателен и играет важную роль в объединении нескольких элементов-переключателей в группу. Для объединения переключателей в группу необходимо установить одинаковое значение атрибута name
и разное значение атрибута value
. Атрибут vаluе
устанавливает значение выбранного переключателя, которое будет отправлено серверу. Значение каждого элемента-переключателя должно быть уникальным внутри группы, для того, чтобы сервер знал, какой вариант ответа выбрал пользователь.
Наличие атрибута checked
(с англ. — установлен) у элемента-переключателя указывает на то, какой из предлагаемых вариантов должен быть выбран по умолчанию при загрузке страницы, если это необходимо. Данный атрибут может быть установлен только у одного элемента-переключателя из группы:
- Попробуй сам »
Сколько Вам лет?
- младше 18
- от 18 до 24
- от 25 до 35
- более 35
Атрибут action.
Главным для элемента является атрибут action , который указывает обработчик данных для формы. Обработчик данных — это файл, описывающий, что нужно делать с данными формы. В качестве результата этой обработки выдается новая HTML-страница, которая возвращается браузеру. Другими словами в атрибуте action указывается URL-путь к файлу-обработчику на сервере (иногда называемого страницей сценария) для обработки формы. Синтаксис следующий:
Файл обработки находится на сервере mytestserver.com
в папке namefolder
и название серверного сценария, который будет обрабатывать данные — obrabotchik.php
. Именно ему и будут переданы все данные, введенные вами в форму на веб-странице. Расширение.php указывает на то, что указанная форма обрабатывается сценарием написанном на языке PHР. Сам обработчик может быть написан на другом языке, например это может быть язык сценариев Python, Ruby и др.
Желательно всегда задавать значение атрибута action
. Если форма должна передать значения на ту же страницу, где она расположена в качестве значения атрибута action укажите пустую строку: action="".
Атрибут method
Атрибут method задает то, каким образом информация должна быть передана на сервер. Выбор метода отправки формы зависит от данных, которые необходимо отправить вместе с ней. Здесь основную роль играет объем этих данных. Наиболее популярными являются два метода передачи исходных данных вашей формы из браузера на сервер: GET и POST . Метод устанавливается любой на выбор, и если вы его не указали, по умолчанию будет использоваться GET . Рассмотрим применение каждого из них.
Метод POST
Метод POST упаковывает данные формы и отсылает их серверу незаметно для пользователя, поскольку данные содержатся в теле сообщения. Веб-браузер, при использовании метода POST отправляет на сервер запрос, состоящий из специальных заголовков за которыми следуют данные формы. Так как содержимое этого запроса доступно только серверу, метод POST применяется для передачи конфиденциальных данных, таких как пароли, реквизиты банковских карт и другая персональная информация пользователей. Метод POST также подходит для отправки больших объемов информации, так как в отличие от метода GET , у него нет ограничений по количеству передаваемых символов.
Метод GET
Как вы уже знаете основная работа браузера — это получать веб-страницы от сервера. Так вот, когда вы используете метод GET , ваш браузер просто получает веб-страницу, как делает это всегда. Метод GET также упаковывает данные формы, но, прежде чем отправить запрос серверу, присоединяет их в конец URL-адреса. Чтобы понять, как работает метод GET , давайте посмотрим его в действии. Откройте в блокноте (например Notepad++) первый пример из этого урока (Пример: Простая HTML-форма) и внесите в HTML-код небольшое изменение: