RUVIDEO
Поделитесь видео 🙏

login page using php

Login and Logout using PHP and HTML . A small example of SESSION is also provided .
Today i will show you how to make a login page in PHP using html and css .

1. Create a file login.php . Login file created .

2. Write HTML to show two text field and a submit button to login .

3. When the login form is ready then run it on browser .This is just a basic login form. we can give it a better look by applying css but here i will cover mostly the php part .

4. To validate your form just add required like it is shown in videos.

5. Next we will submit the form and will check if the submitted values are matching with database values or not .

6. So before submitting we will create a database and a table under it . Lets do it .

7. So we created a database with name user_records and a table with name user . Now lets add some values from phpmyadmin console . So now data is inserted and table user has one row .

8. Now we will redirect the forms to a different php file . Lets do it . We created a file called login_check.php

9. Now we will submit the form and see what will happen ? So after submitting , the form is redirected to login_check.php. Now we will check if we are getting the values which are submitted . Ok ? So we are getting the submitted value at this page .

10. Now we will include a db.php file for connecting to database . Ok? If you don't have any db.php file lets create it and place a code like i did in video. So we have updated the db credential in the db.php file . Now lets include it in login_check.php . You can see db connection is successful .

11. Now we will write a MySQL query to see if the records submitted are matching with db records or not ? $conn because it is used as a variable in db.php . You can see it is the mysql link to make a connection to db .

12. Now we will see if the values submitted are matching with db records or not . Let see .We can see an error so lets debug it . So you can see where was the error . " was missing at the end of the MySQL query . You can see mysqli_num_rows is returning zero that means the records which we have submitted is not matching with db records . Lets try to put correct values now, ok ? It is still returning zero so now we will print the query and run it on mysql interface . SO you noticed the error ? Now it is returning mysqli_num_rows value as 1 means data is matching . This was you can debug the issue as well which you do coding in PHP .

13. Now we will integrate logout button when user is logged in . We will also integrate session .

14. We will make a file user_info.php . You can see a session value is assigned as the records matches . You can see we are redirecting to unser_info.php . So it is redirected to user_info.php . You can always take help of official php website to know more about the functions .

15. On user_info.php file you can see we are printing the session value so session value is available across all pages .
Now you can see i have placed a logout link to destroy the session .

16. Now lets make a logout.php file and destroy the session . Now we are logged out .

17. Now i will check if we can go to user_info.php page without logging in or not ? You can see we are not allowed to view

So this is how login and logout works . When we are logging in then we are assigning the value to session variable and when we are logging out then we are destroying the session .

Thank You .

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «login page using php», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.