The form and back-end database verify whether the account password is correct. Errors are displayed on the current page without jumping.
哈哈哈哈。
哈哈哈哈。 2018-07-12 07:44:14
0
4
1400

I wrote a form. In php, I want to directly connect to the backend database for verification by clicking on login. If it is correct, it will be adjusted directly to the next page. If it is incorrect, the information about the wrong account and password will be displayed directly on the login page. No. Jump back and forth.

I read a lot of them. First jump to the verification php page. If it is correct, take the next step. If it is not correct, it will be very troublesome to open it again to log in to php.


Does anyone know?

哈哈哈哈。
哈哈哈哈。

reply all(3)
You bad bad

Exit() if error occurs; try

NULL

If the front-end and back-end are separated, use ajax. If it is PHP+HTML, I will give you a code reference

<?php

@$username = $_REQUEST['username']; //Get the account number submitted on this page

@$password = $_REQUEST['password'];//Get the password submitted on this page

$status = false ;//Define a state

if (isset($username) || isset($password)) {

//If both the username and password are available, execute the verification logic, If there is an error, change $status to an error message, such as incorrect account and password

}

?>

<html>

<body>

<!-- The action submission address of the form is the PHP file of the current page-->

<form action="/login.php" method="post">

  <?php if ($status !== false ) { echo "<div>".$status."</div>" } ? >

                                                                                                                                                             

<button type="submit">Login</button>


##</form>

<body>

</html>

无忌哥哥

Just use ajax, the page will not switch.

  • reply I want to use php to implement it. I want to understand php and then optimize it using jq.
    哈哈哈哈。 author 2018-07-12 09:18:35
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template