Hướng dẫn how to display user details after login in php source code - cách hiển thị chi tiết người dùng sau khi đăng nhập bằng mã nguồn php

Trong các trang web mạng xã hội như Facebook, Instagram, v.v., tên người dùng và hình ảnh hồ sơ của người dùng đã đăng nhập được hiển thị trong tiêu đề của trang web và tiêu đề đó vẫn không đổi, không phân biệt trang web mà người dùng đã mở. Chức năng đó có thể được tạo bằng cách sử dụng các biến phiên. & NBSP; Các biến phiên chỉ tồn tại trong khi phiên của người dùng đang hoạt động. Sau khi phiên hoàn tất, các biến phiên bị phá hủy. Đây là duy nhất cho mỗi khách truy cập và thường được sử dụng để lưu trữ thông tin dành riêng cho người dùng như tên người dùng, ảnh hồ sơ, v.v., sau khi người dùng đăng nhập. & NBSP; Mã: & nbsp; Đây là một hệ thống đăng ký đơn giản. Trang đăng ký.php yêu cầu tên người dùng, email và mật khẩu mong muốn của người dùng, sau đó gửi dữ liệu đã nhập vào cơ sở dữ liệu, sau khi nhấp vào nút gửi. Sau đó, người dùng được chuyển hướng đến trang index.php trong đó tin nhắn chào mừng và tên người dùng của người dùng đã đăng nhập được hiển thị. Bước đầu tiên là tạo cơ sở dữ liệu và sau đó là một bảng bên trong nó. Cơ sở dữ liệu được đặt tên là ‘Đăng ký, và bảng được đặt tên là‘ người dùng. Bảng ‘người dùng sẽ chứa 4 trường. & NBSP;session variables
Session variables exist only while the user’s session is active. After the session is complete, the session variables get destroyed. These are unique for each visitor and are generally used to store user-specific information such as the username, profile picture etc, once the user logs in. 
The session variables are used to display logged in user information in PHP.
Project Explanation and Code: 
This is a simple registration system. The register.php page asks for the desired username, email, and password of the user, and then sends the entered data into the database, once the submit button is clicked. After this, the user is redirected to the index.php page where a welcome message and the username of the logged-in user is displayed.
The first step is to create a database, and then a table inside it. The database is named ‘registration’, and the table is named ‘users’. The ‘users’ table will contain 4 fields. 

  1. ID - Khóa chính - Tăng tự động
  2. Tên người dùng - Varchar [100]
  3. Email - Varchar [100]
  4. Mật khẩu - Varchar [100] ‘ID, sẽ là khóa chính, điều đó có nghĩa là nó sẽ là duy nhất cho mỗi người dùng đã đăng ký. Nó cũng sẽ tự động tăng cho mỗi đăng ký mới. Kiểu dữ liệu cho tên người dùng, email và mật khẩu sẽ là varchar. Kích thước có thể được điều chỉnh theo yêu cầu tuy nhiên, 100 là đủ.sql mã cho bảng: & nbsp; & nbsp;
    The ‘id’ will be the primary key, it means that it will be unique for every registered user. It will also auto-increment for every new registration. The data type for username, email and password will be varchar. The size can be adjusted as per the requirement however, 100 is sufficient.
    SQL code for the table:  

SQL

CREATE TABLE `users` [

    `id` ___

    TABLE4TABLE5TABLE6NOT NULLTABLE2

    `users` [1TABLE5TABLE6NOT NULLTABLE2

Các

    5

PhpMyAdmin sau cơ sở dữ liệu và tạo bảng

Thư mục dự án, chứa các tệp cần thiết

error.php

HTML

________ 36 ________ 37 & nbsp;     8

    `id` 0`id` 1 `id` 2`id` 3`id` 4`id` 5

`id` 6    6    7 `id` 9

`id` 0int1int22 ____37

`id` 6    6    7 [11] 0

    [11] 2`id` 1`id` 5

________ 36 ________ 37 & nbsp; [11] 7

Giải thích: Tệp ERROR.php chịu trách nhiệm giữ các thông báo lỗi của hệ thống. Giả sử người dùng nhập sai tên người dùng và mật khẩu sai, sau đó trong các trường hợp như vậy, các thông báo lỗi sẽ được lưu trữ trong biến $ ERROR, sau đó sẽ được hiển thị cho người dùng bằng cách sử dụng ‘Echo; chức năng của php.server.php & nbsp; The error.php file is responsible for holding the error messages of the system. Suppose the user enters the wrong username and password combination, then in such cases, the error messages will be stored in the $error variable, which will then be displayed to the user using ‘echo; function of PHP.
server.php 

PHP

[11] 8

[11] 9

NOT0 NOT1______72

________ 74 & nbsp; & nbsp; & nbsp; NOT1NOT2NOT3

NOT8 NOT1NULL0NULL1

NULL2NULL3NULL4NULL5NOT2NOT3

Is

AUTO_INCREMENT 8 AUTO_INCREMENT 9TABLE00NULL3TABLE022

    NOT0 TABLE06NULL8AUTO_INCREMENT 1TABLE00NULL3TABLE11TABLE12

    NOT4 TABLE06NULL8AUTO_INCREMENT 1TABLE00NULL3TABLE20TABLE12

Các

Các

    AUTO_INCREMENT 8 TABLE42TABLE43TABLE42NOT0TABLE46__

    AUTO_INCREMENT 8 TABLE42TABLE43TABLE42NOT4TABLE46__

    AUTO_INCREMENT 8 TABLE42TABLE43TABLE42TABLE23TABLE46TABLE47TABLE42______

    AUTO_INCREMENT 8 TABLE42TABLE23 TABLE83TABLE32TABLE85

`id` 6TABLE47TABLE42NOT8AUTO_INCREMENT 1TABLE91AUTO_INCREMENT 7

    TABLE94

    AUTO_INCREMENT 8 TABLE42TABLE98TABLE42NOT8`users` [01

`id` 6`users` [03 `users` [04TABLE23AUTO_INCREMENT 7

`id` 6`users` [08 `users` [09

`users` [10`users` [11`users` [12AUTO_INCREMENT 1`users` [14AUTO_INCREMENT 1`users` [16`users` [17

`id` 6`users` [19NULL8AUTO_INCREMENT 1`users` [08AUTO_INCREMENT 7

`id` 6NULL2NULL3TABLE11NULL5NOT0NOT3

Các

`id` 6`users` [39`users` [40AUTO_INCREMENT 7

    TABLE94

TABLE94

AUTO_INCREMENT 8 AUTO_INCREMENT 9TABLE00NULL3`users` [49TABLE03

    NOT0 TABLE06NULL8AUTO_INCREMENT 1TABLE00NULL3TABLE11TABLE12

Các

    AUTO_INCREMENT 8 TABLE42TABLE43TABLE42NOT0`users` [75

`id` 6TABLE47TABLE42NOT8AUTO_INCREMENT 1TABLE51AUTO_INCREMENT 7

    TABLE94

    AUTO_INCREMENT 8 TABLE42TABLE43TABLE42`users` [03`users` [75

`id` 6TABLE47TABLE42NOT8AUTO_INCREMENT 1TABLE77AUTO_INCREMENT 7

    TABLE94

    AUTO_INCREMENT 8 TABLE42TABLE98TABLE42NOT8`users` [01

`id` 6`users` [03 `users` [04`users` [03AUTO_INCREMENT 7

`id` 6`users` [08     15

    16`users` [12     18`users` [16    20

`id` 6    22     23NULL8AUTO_INCREMENT 1`users` [08AUTO_INCREMENT 7

`id` 6AUTO_INCREMENT 8     30__32222

Các

    33NULL2NULL3NULL4NULL5    45NOT3

    33`users` [39`users` [40AUTO_INCREMENT 7

`id` 6TABLE94

`id` 6    54     55

    33TABLE47TABLE42NOT8AUTO_INCREMENT 1    61AUTO_INCREMENT 7

`id` 6TABLE94

    TABLE94

TABLE94

    68

Giải thích: Phiên được bắt đầu bằng phương thức session_start []. Sau đó, các biến được khai báo và một mảng lỗi được tạo. Nó sẽ lưu trữ tất cả các thông báo lỗi. Trang server.php sau đó được kết nối với cơ sở dữ liệu ‘đăng ký được tạo trước đó. Sau khi người dùng nhấp vào nút ‘Đăng ký trên nút Đăng ký.php, dữ liệu được nhập được gửi đến cơ sở dữ liệu và điều này hoàn thành đăng ký mới. Tuy nhiên, xác thực biểu mẫu được thực hiện trước đó để đảm bảo rằng người dùng đang điền chính xác biểu mẫu. Tất cả các trường được yêu cầu và không thể để trống. Line 18 - 21: MySQLI_REAL_ESCAPE_STRING thoát khỏi các ký tự đặc biệt trước khi gửi dữ liệu đến cơ sở dữ liệu. Điều này rất cần thiết cho bảo mật cơ sở dữ liệu từ SQL Inject.line 25 - 27: Những dòng này đảm bảo rằng người dùng đang điền tất cả các hộp đầu vào và liệu ‘mật khẩu và‘ xác nhận mật khẩu. Nếu cả hai mật khẩu khớp, thì mã tiếp tục chạy.line 29 - 32: Kiểm tra xem mật khẩu có khớp hay không. được mã hóa và dữ liệu được nhập được gửi đến cơ sở dữ liệu. Sau khi quá trình đăng ký hoàn tất, tên người dùng được lưu trữ trong biến phiên và người dùng được chuyển hướng đến trang index.php, trong đó anh ta được yêu cầu nhập thông tin đăng nhập.line 50 - 80: Đầu tiên tên người dùng và mật khẩu nhập vào vệ sinh. Điều này rất cần thiết để tăng bảo mật cơ sở dữ liệu, vì nó loại bỏ cơ hội của bất kỳ SQL tiêm nào. Người dùng nhận được thông báo lỗi nếu tên người dùng hoặc trường mật khẩu bị trống. & NBSP; Nếu số lượng lỗi cho đến khi điểm mã này được tìm thấy là 0, thì kiểm tra cơ sở dữ liệu được chạy. Nếu tên người dùng được nhập bởi người dùng được tìm thấy có trong cơ sở dữ liệu, thì người dùng đăng nhập thành công. Người dùng sau đó được chuyển hướng đến ‘index.php. The session is started using session_start[] method. After that, the variables are declared and an error array is created. It will store all the error messages. The server.php page is then connected to the ‘registration’ database created earlier. After the user clicks the ‘register’ button on the register.php button, the data entered is sent to the database, and this completes a new registration. However, form validation is done before that to make sure that the user is filling the form correctly. All the fields are required and cannot be left blank.
Line 18 – 21: mysqli_real_escape_string escapes the special characters before sending the data to the database. This is essential for database security from SQL injections.
Line 25 – 27: These lines makes sure that the user is filling all the input boxes, and whether the ‘password’ and ‘confirm password’ matches. If both the password matches, then the code further runs.
Line 29 – 32: Checking whether the password matches or not. 
Line 35 – 46: If the number of errors until this point is zero, the password is then ‘md5’ encrypted and the data entered is sent to the database. After the registration process is complete, the username is stored in the session variable, and the user is redirected to the index.php page, where he is asked to enter the login credentials.
Line 50 – 80: First the username and password entered in sanitized. This is essential to increase database security, as it eliminates the chances of any SQL injection. The user gets an error message if the username or the password field is left blank. 
If the number of errors until this point of code is found to be 0, then a database check is run. If the username entered by the user is found to be present in the database, then the user successfully logs in. The user is then redirected to the ‘index.php’ page.
login.php 
 

HTML

    6    7     71

    72

`id` 0    74`id` 5

`id` 0    77`id` 5

    `id` 0    81`id` 5

`id` 6    84

`id` 6    86

    [11] 2    81`id` 5

    `id` 0    93     94`id` 3    96     97`id` 3    99

    33`id` 01`id` 3`id` 03`id` 5

[11] 2    77`id` 5

`id` 0`id` 09`id` 5

    `id` 0`id` 1 `id` 2`id` 3`id` 16`id` 5

`id` 6`id` 0`id` 20`id` 21`id` 20`id` 5

    [11] 2`id` 1`id` 5

    `id` 0`id` 30 `id` 31`id` 3`id` 33 `id` 34`id` 3`id` 36`id` 5

`id` 6    6    7 `id` 41

`id` 6`id` 0`id` 1 `id` 2`id` 3`id` 47`id` 5

    33`id` 0`id` 51`id` 52`id` 51`id` 5

    33`id` 0`id` 57     97`id` 3__

`id` 6[11] 2`id` 1`id` 5

`id` 6`id` 0`id` 1 `id` 2`id` 3`id` 47`id` 5

    33`id` 0`id` 51`id` 79`id` 51`id` 5

    33`id` 0`id` 57     97`id` 3`id` 87 `id` 61`id` 3__

`id` 6[11] 2`id` 1`id` 5

`id` 6`id` 0`id` 1 `id` 2`id` 3`id` 47`id` 5

Các

int12`id` 61`id` 3int15`id` 5

    16int18

    33[11] 2int05`id` 5

`id` 6[11] 2`id` 1`id` 5

`id` 0int1`id` 5

    33int31

    33`id` 0int34 `id` 01`id` 3int37`id` 5

    16int40

    33[11] 2int34`id` 5

`id` 6[11] 2int1`id` 5

    [11] 2`id` 30`id` 5

[11] 2`id` 09`id` 5

[11] 2    74`id` 5

Giải thích: Trang đăng nhập của hệ thống. Người dùng phải nhập tên người dùng và mật khẩu để đăng nhập thành công. Sau khi nhấn nút đăng nhập, mã đăng nhập được ghi trong trang server.php được chạy, tất cả các phụ trợ hoạt động, như kiểm tra xem tên người dùng và mật khẩu có khớp hoặc không.register.php & nbsp; & nbsp; Login page of the system. The user has to enter the username and password to successfully log in. After the login button is pressed, the login code written in the server.php page is run, which does all the backend work, like checking whether the username and password match or not.
register.php 
 

PHP

int59int60TABLE42int62int63

    72

int65

int66

    int68

`id` 6int70int71 int72

    int74

    int76    96 int78    99

int80int81`id` 03`id` 5

int84

int85

    int87`id` 2`id` 3`id` 16`id` 5

`id` 6int93

    int95

    int97`id` 33 int99int37`id` 5

`id` 6int59int60TABLE42[11] 06[11] 07

`id` 6int87`id` 2`id` 3`id` 47`id` 5

    33[11] 15

    33[11] 17`id` 60 [11] 19`id` 63

    16[11] 22[11] 23`id` 5

`id` 6int95

`id` 6int87`id` 2`id` 3`id` 47`id` 5

    33[11] 34

    33[11] 17[11] 37 [11] 19[11] 37

    16[11] 222.

`id` 6int95

`id` 6int87`id` 2`id` 3`id` 47`id` 5

    33[11] 53

    33[11] 17`id` 87 [11] 19[11] 58`id` 5

`id` 6int95

`id` 6int87`id` 2`id` 3`id` 47`id` 5

    33[11] 69

    33[11] 17`id` 87 [11] 19[11] 74`id` 5

`id` 6int95

`id` 6int87`id` 2`id` 3`id` 47`id` 5

    33[11] 85int08 `id` 2`id` 3int11

[11] 90[11] 19[11] 92`id` 5

    16[11] 95

    33[11] 97

`id` 6int95

NOT00

    33NOT02

    33NOT04`id` 36`id` 5

    16NOT08

    33NOT10

`id` 6NOT12

    NOT14

NOT15

NOT16

Giải thích: Trang này chứa mã hóa HTML của trang đăng ký. Các trang ‘server.php và‘ lỗi.php, được bao gồm trong các dòng 01 và 15 tương ứng. Điều này là cần thiết để làm cho phần phụ trợ của hệ thống đăng ký hoạt động. Người dùng được yêu cầu nhập tên người dùng, email và mật khẩu để tạo tài khoản. Sau khi các trường đầu vào được điền, dữ liệu được nhập được gửi đến bảng cơ sở dữ liệu.index.php & nbsp; & nbsp; This page contains the HTML coding of the registration page. The ‘server.php’, and ‘errors.php’ pages are included in lines 01 and 15 respectively. This is necessary to make the backend of the registration system work. The user is asked to enter the username, email, and password to create an account. After the input fields are filled, the data entered is sent to the database table.
index.php 
 

HTML

    6    7

NOT19

NOT20

[11] 9

NOT22

NOT23

NOT24

NOT25

NOT26

    NOT28

    NOT30

TABLE94

NOT32

NOT33

NOT34

NOT35

NOT36

    NOT38

    NOT40

    NOT42

TABLE94

    68

    72

`id` 0    74`id` 5

`id` 0    77`id` 5

    `id` 0    81NOT55    81`id` 5

    `id` 0    93     94`id` 3    96     97`id` 3    99

int80`id` 01`id` 3`id` 03`id` 5

[11] 2    77`id` 5

`id` 0`id` 09`id` 5

    `id` 0`id` 1 `id` 2`id` 3`id` 16`id` 5

`id` 6`id` 0`id` 20NOT88`id` 20`id` 5

    [11] 2`id` 1`id` 5

    `id` 0`id` 1 `id` 2`id` 3NULL00`id` 5

`id` 6    6    7 NULL05

    33`id` 0`id` 1 `id` 2`id` 3NULL11 `id` 5

    16`id` 0NULL15`id` 5

int80    6    7

int12NULL21

int12NULL23

int80    68

    16[11] 2NULL15`id` 5

    33[11] 2`id` 1`id` 5

`id` 6    6    7 [11] 7

________ 46 ________ 36 ________ 37 & nbsp; NULL41

`id` 0int1`id` 5

    16NULL46

    16`id` 0NULL49`id` 5

int80    6    7 NULL54

    16[11] 2NULL49`id` 5

    33[11] 2int1`id` 5

`id` 0int1`id` 5

    16`id` 0int34 `id` 01`id` 3NULL71 NULL72`id` 3__

int80NULL77

    16[11] 2int34`id` 5

    33[11] 2int1`id` 5

`id` 6    6    7 [11] 7

    [11] 2`id` 1`id` 5

[11] 2`id` 09`id` 5

[11] 2    74`id` 5

Giải thích: & NBSP; Dòng 01 - 19: Tên người dùng được lưu trữ trong biến phiên hiện được hiển thị lại cho người dùng. Biến phiên này có thể bị phá hủy bằng cách sử dụng UNSET [$ _ Phiên [Sản phẩm trực tuyến]] hoặc session_destroy []. Tuy nhiên, session_destroy [] sẽ phá hủy tất cả các biến phiên cùng một lúc. Để tiêu diệt chỉ biến phiên 'Tên người dùng', sẽ tốt hơn nếu giải quyết biến bằng cách sử dụng unset [phiên $ _ [Sản phẩm trực tuyến]]. Dòng 34 - 42: Điều này đảm bảo rằng trang này chỉ có thể truy cập được cho những người dùng được ghi lại in.line 45 - 50: Điều này hiển thị thông báo chào mừng được cá nhân hóa cho người dùng sau khi họ đăng nhập tệp.css & nbsp; 
Line 01 – 19: The username that was stored in the session variable is now displayed back to the user. This session variable can either be destroyed using unset[$_SESSION[“products”]] or session_destroy[]. However, session_destroy[] will destroy all the session variables at once. To destroy only the ‘username’ session variable, it will be better to unset the variable using unset[$_SESSION[“products”]].
Line 34 – 42: This makes sure that this page is accessible only to those users that are logged in.
Line 45 – 50: This displays a personalized welcome message to the user once they log in.
CSS File
 

CSS

AUTO_INCREMENT 00

    AUTO_INCREMENT 02AUTO_INCREMENT 03AUTO_INCREMENT 04NOT3

    AUTO_INCREMENT 07AUTO_INCREMENT 03AUTO_INCREMENT 04NOT3

TABLE94

AUTO_INCREMENT 12

    AUTO_INCREMENT 14AUTO_INCREMENT 03AUTO_INCREMENT 16NOT3

    AUTO_INCREMENT 19AUTO_INCREMENT 03AUTO_INCREMENT 21NOT3

TABLE94

AUTO_INCREMENT 24

    AUTO_INCREMENT 26AUTO_INCREMENT 03AUTO_INCREMENT 28NOT3

    AUTO_INCREMENT 02AUTO_INCREMENT 03AUTO_INCREMENT 33 AUTO_INCREMENT 34 AUTO_INCREMENT 04NOT3

    AUTO_INCREMENT 38AUTO_INCREMENT 03AUTO_INCREMENT 40NOT3

    AUTO_INCREMENT 19AUTO_INCREMENT 03AUTO_INCREMENT 45NOT3

    AUTO_INCREMENT 48AUTO_INCREMENT 03AUTO_INCREMENT 50NOT3

    AUTO_INCREMENT 53AUTO_INCREMENT 03AUTO_INCREMENT 55 AUTO_INCREMENT 56 AUTO_INCREMENT 57NOT3

    AUTO_INCREMENT 60AUTO_INCREMENT 03AUTO_INCREMENT 62NOT3

    AUTO_INCREMENT 65AUTO_INCREMENT 66 AUTO_INCREMENT 66 AUTO_INCREMENT 04 AUTO_INCREMENT 04NOT3

    AUTO_INCREMENT 07AUTO_INCREMENT 03AUTO_INCREMENT 74NOT3

TABLE94

AUTO_INCREMENT 77

    AUTO_INCREMENT 26AUTO_INCREMENT 03AUTO_INCREMENT 28NOT3

    AUTO_INCREMENT 02AUTO_INCREMENT 03AUTO_INCREMENT 04 AUTO_INCREMENT 34NOT3

    AUTO_INCREMENT 07AUTO_INCREMENT 03AUTO_INCREMENT 74NOT3

    AUTO_INCREMENT 53AUTO_INCREMENT 03AUTO_INCREMENT 55 AUTO_INCREMENT 56 AUTO_INCREMENT 57NOT3

    AUTO_INCREMENT 65AUTO_INCREMENT 66 AUTO_INCREMENT 66 AUTO_INCREMENT 04 AUTO_INCREMENT 04NOT3

    AUTO_INCREMENT 02AUTO_INCREMENT 03AUTO_INCREMENT 04 AUTO_INCREMENT 34NOT3

TABLE94

TABLE014

    AUTO_INCREMENT 19AUTO_INCREMENT 03AUTO_INCREMENT 40NOT3

TABLE94

TABLE024

    TABLE026AUTO_INCREMENT 03TABLE028NOT3

    AUTO_INCREMENT 48AUTO_INCREMENT 03TABLE033NOT3

    AUTO_INCREMENT 02AUTO_INCREMENT 03TABLE038NOT3

    AUTO_INCREMENT 14AUTO_INCREMENT 03AUTO_INCREMENT 74NOT3

TABLE94

TABLE046

    TABLE048AUTO_INCREMENT 03TABLE050NOT3

    AUTO_INCREMENT 65AUTO_INCREMENT 04 AUTO_INCREMENT 04 AUTO_INCREMENT 66 AUTO_INCREMENT 66.

Is

    AUTO_INCREMENT 14AUTO_INCREMENT 03TABLE066NOT3

    AUTO_INCREMENT 65AUTO_INCREMENT 66NOT3

    AUTO_INCREMENT 26AUTO_INCREMENT 03TABLE0555NOT3

TABLE94

TABLE080

    TABLE082AUTO_INCREMENT 03TABLE084NOT3

    AUTO_INCREMENT 07AUTO_INCREMENT 03TABLE089NOT3

    AUTO_INCREMENT 14AUTO_INCREMENT 03TABLE094NOT3

    AUTO_INCREMENT 38AUTO_INCREMENT 03AUTO_INCREMENT 40NOT3

    AUTO_INCREMENT 19AUTO_INCREMENT 03TABLE104NOT3

    AUTO_INCREMENT 07AUTO_INCREMENT 03TABLE038 AUTO_INCREMENT 66.

    AUTO_INCREMENT 65AUTO_INCREMENT 66NOT3

TABLE94

TABLE116

    AUTO_INCREMENT 26AUTO_INCREMENT 03TABLE120NOT3

    AUTO_INCREMENT 02AUTO_INCREMENT 03AUTO_INCREMENT 04 AUTO_INCREMENT 34NOT3

    AUTO_INCREMENT 07AUTO_INCREMENT 03AUTO_INCREMENT 66NOT3

    AUTO_INCREMENT 19AUTO_INCREMENT 03AUTO_INCREMENT 40NOT3

    AUTO_INCREMENT 38AUTO_INCREMENT 03TABLE138NOT3

    AUTO_INCREMENT 19AUTO_INCREMENT 03TABLE148NOT3

    AUTO_INCREMENT 65TABLE038NOT3

    AUTO_INCREMENT 48AUTO_INCREMENT 03TABLE033NOT3

TABLE94

TABLE160

    AUTO_INCREMENT 65AUTO_INCREMENT 04 AUTO_INCREMENT 04 AUTO_INCREMENT 66 AUTO_INCREMENT 66.

    AUTO_INCREMENT 19AUTO_INCREMENT 03TABLE169NOT3

Is

    TABLE179AUTO_INCREMENT 03AUTO_INCREMENT 74NOT3

TABLE94

    AUTO_INCREMENT 26AUTO_INCREMENT 03TABLE0555NOT3
 

    AUTO_INCREMENT 07AUTO_INCREMENT 03TABLE038 AUTO_INCREMENT 66.

    AUTO_INCREMENT 53AUTO_INCREMENT 03AUTO_INCREMENT 55 AUTO_INCREMENT 56 TABLE0777__

    AUTO_INCREMENT 53AUTO_INCREMENT 03AUTO_INCREMENT 62NOT3

    AUTO_INCREMENT 53AUTO_INCREMENT 03AUTO_INCREMENT 55 AUTO_INCREMENT 56 TABLE138NOT3

Tên truy nhập không chính xác và kết hợp mật khẩu

Làm thế nào để chạy dự án này?

Các mã nguồn của dự án này có thể được lấy từ kho lưu trữ GitHub này. Sau khi tải xuống và giải nén dự án, hãy làm theo các bước đã cho để chạy chương trình: & NBSP;
After downloading and unzipping the project, follow the given steps to run the program: 

  • Tải xuống tất cả các tệp hoặc sao chép kho lưu trữ vào hệ thống cục bộ của bạn.
  • Tạo một cơ sở dữ liệu có tên ‘Đăng ký, và một bảng có tên‘ Người dùng. Mã MySQL của bảng đã được cung cấp ở trên.
  • Sử dụng Xamp hoặc Wamp để chạy hệ thống trên Localhost.
  • Đảm bảo rằng các cổng cần thiết để chạy máy chủ Apache và MySQL là miễn phí. Nếu không, thì bạn sẽ phải thay đổi số cổng.

HTML là nền tảng của các trang web, được sử dụng để phát triển trang web bằng cách cấu trúc các trang web và ứng dụng web.

PHP là ngôn ngữ kịch bản phía máy chủ được thiết kế dành riêng cho phát triển web. Bạn có thể học PHP từ đầu bằng cách làm theo hướng dẫn PHP và các ví dụ PHP này.


Làm cách nào để xem chi tiết người dùng trong PHP?

Trang đăng ký.php yêu cầu tên người dùng, email và mật khẩu mong muốn của người dùng, sau đó gửi dữ liệu đã nhập vào cơ sở dữ liệu, sau khi nhấp vào nút gửi. Sau này, người dùng được chuyển hướng đến chỉ mục. Trang PHP trong đó tin nhắn chào mừng và tên người dùng của người dùng đã đăng nhập được hiển thị. php page asks for the desired username, email, and password of the user, and then sends the entered data into the database, once the submit button is clicked. After this, the user is redirected to the index. php page where a welcome message and the username of the logged-in user is displayed.

Làm thế nào lấy dữ liệu từ cơ sở dữ liệu của một người dùng cụ thể sau khi đăng nhập PHP?

Lấy hoặc tìm nạp dữ liệu từ cơ sở dữ liệu trong PHP..
Chọn Cột_Name [S] từ Table_Name ..
$ query = mysql_query ["Chọn * từ TableName", $ Connection] ;.
$ Kết nối = mysql_connect ["localhost", "root", ""] ;.
$ db = mysql_select_db ["công ty", $ kết nối] ;.
$ query = mysql_query ["Chọn * từ nhân viên", $ Connection] ;.

Làm cách nào để hiển thị tên người dùng của tôi?

Trong hộp, nhập CMD và nhấn ENTER. Cửa sổ nhắc lệnh sẽ xuất hiện.Type Whoami và nhấn Enter.Tên người dùng hiện tại của bạn sẽ được hiển thị. The command prompt window will appear. Type whoami and press Enter. Your current user name will be displayed.

Làm thế nào tôi có thể biết tên người dùng và mật khẩu PHP của tôi?

PHP $ servername = "localhost";$ username = "root";$ password = "";$ databasename = "test";$ Conn = mysqli_connect [$ servername, $ username, $ password, $ databasename];$ un = $ _post ['tên người dùng'];$ pw = $ _post ['mật khẩu'];In $ Pass.

Bài Viết Liên Quan

Chủ Đề