# Bước 0: Bước chuẩn bị giao diện để viết chức năng đăng nhập

Tìm hiểu cách viết ngắn gọn mysql.php

{% file src="https://3988971916-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LXUV09EJOZ8BKB8YL5I%2Fuploads%2FAouWu4a8h52MweoOGMxr%2FMysql.php?alt=media&token=c507a37f-15b0-4e58-9796-16af6f89fc3c" %}

{% file src="https://3988971916-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LXUV09EJOZ8BKB8YL5I%2Fuploads%2FzP5yiVOc3jZPrSjgD2w5%2Fbandachinhsua.rar?alt=media&token=b745da7a-3dd8-42e3-9566-3e16e7b7789e" %}



Chúng ta phải xây dụng được mảng email, mảng password như sau

```
array (
  'email' => 
  array (
    'type' => 'text',
  ),
  'password' => 
  array (
    'type' => 'password',
  )
)
```

![](https://3988971916-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LXUV09EJOZ8BKB8YL5I%2F-M4efvYGU-9CLdtVpoKj%2F-M4ehHXDEQc3fctDgJG5%2FScreenshot_1.png?alt=media\&token=84b03308-030c-4465-8e24-a184009bda38)

![](https://3988971916-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LXUV09EJOZ8BKB8YL5I%2F-M4efvYGU-9CLdtVpoKj%2F-M4ehKObMqBMA884S0Vh%2FScreenshot_2.png?alt=media\&token=c7403c89-28f9-478f-aec9-8936706b3eb5)

![](https://3988971916-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LXUV09EJOZ8BKB8YL5I%2F-M4efvYGU-9CLdtVpoKj%2F-M4ehOUFN2m7rZbT8u8y%2FScreenshot_3.png?alt=media\&token=8a94b7b9-fd84-4982-ba4f-1b74cbb8f4fa)

![](https://3988971916-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LXUV09EJOZ8BKB8YL5I%2F-M4efvYGU-9CLdtVpoKj%2F-M4ehQzOYCtfQhzDBNN1%2FScreenshot_4.png?alt=media\&token=00087a12-70e2-4b74-855b-0e13e5f057e2)

![](https://3988971916-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LXUV09EJOZ8BKB8YL5I%2F-M4efvYGU-9CLdtVpoKj%2F-M4ehTFKP8nC2lEB7o3Q%2FScreenshot_5.png?alt=media\&token=d0a683e9-1602-47f2-b135-88fb503c269a)

![](https://3988971916-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LXUV09EJOZ8BKB8YL5I%2F-M4efvYGU-9CLdtVpoKj%2F-M4ehVNjHDb1IVfhoXXT%2FScreenshot_6.png?alt=media\&token=3c7057b4-6488-4bd9-bd49-ea6de25b5ae3)

Mail: phamngoctuong1805@gmail.com\
pass: 123456

{% file src="https://3988971916-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LXUV09EJOZ8BKB8YL5I%2F-MlWE_1K7Mm2gXKUEmPm%2F-MlWFJUWvI_9OrFB0ueJ%2FDa%20co%20du%20lieu.zip?alt=media&token=e14e9697-56fd-498a-bbcf-db663c075b52" %}

File html && library

{% file src="https://3988971916-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LXUV09EJOZ8BKB8YL5I%2F-M4efvYGU-9CLdtVpoKj%2F-M4ehYuzil5CXc5Cq70K%2Ftestoop.rar?alt=media&token=d830ce71-7f92-4310-8f5d-af8583e0891f" %}

Refer

{% file src="https://3988971916-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LXUV09EJOZ8BKB8YL5I%2Fuploads%2FVl8RQv2QOa1X6yYTbo5t%2FRefer.zip?alt=media&token=c6090844-c1ce-4b9f-83ed-9b919bc177b7" %}

{% file src="https://3988971916-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LXUV09EJOZ8BKB8YL5I%2Fuploads%2FZlDdpilxrLSZXbzTl3YI%2Fticket.rar?alt=media&token=72fd7c63-9783-4b30-a43c-cc74c07daa2e" %}
