+ 10

How do you create log in form in html

12th Jul 2018, 5:09 AM
Innocent
Innocent - avatar
3 ответов
+ 7
thanks
26th Jul 2018, 8:53 PM
Innocent
Innocent - avatar
+ 3
Html <form action="login.php"> <input name="username"> <input type="password" name="password"> <input type="submit" name="loginsubmit"> </form> login.php <?php session_start (); if (isset ($_POST ['loginsubmit'])){ $db = mysqli_connect (localhost, $dbusername, $dbpassword, $dbname); $username = $_POST ['username']; $password = $_POST ['password']; $check = "SELECT * FROM users WHERE username='$username'"; $checksql = mysqli_query ($db, $check); $row = mysqli_fetch_assoc ($checksql); //password check $checkpass = password_verify ($password, $); if ($checkpass === true){ //login to user $_SESSION ['username'] = $username; } }
25th Jul 2018, 5:11 PM
Pragnesh Katkar
Pragnesh Katkar - avatar