+ 1

Warning: mysqli_query() expects parameter 1 to be mysqli, null given in /storage/emulated/legacy/htdocs/new/login-process.php o

28th Nov 2017, 3:37 AM
michael ahianyo
michael ahianyo - avatar
11 ответов
+ 1
<?php if (isset($_POST['submit'])) { $username = $_POST['username']; $password = $_POST['password']; include("connect.php"); $result = mysqli_query($con,"select * from users where " . "username='$username'and pass='$password'"); if(mysqli_num_rows($result) == 1) { $_SESSION['username'] = $username; header('Location: home.php'); } else { $error ="Invalid Login"; } } else { // header('Location: index.php'); } ?>
28th Nov 2017, 4:11 AM
michael ahianyo
michael ahianyo - avatar
0
I don't know what is actually wrong with it plus I Need urgent help
28th Nov 2017, 3:38 AM
michael ahianyo
michael ahianyo - avatar
0
ok
28th Nov 2017, 4:10 AM
michael ahianyo
michael ahianyo - avatar
0
?php define("HOST", "localhost"); define("DBUSER", "root"); define("PASS", ""); define("DB", "data"); $conn = mysqli_connect(HOST, DBUSER, PASS, DB); if (!$conn) { die('Could not connect !<br />Please contact the site\'s administrator.'); }; ?>
28th Nov 2017, 4:16 AM
michael ahianyo
michael ahianyo - avatar
0
ok
28th Nov 2017, 4:20 AM
michael ahianyo
michael ahianyo - avatar
0
thank you dear it worked
28th Nov 2017, 4:24 AM
michael ahianyo
michael ahianyo - avatar
0
pls can I ask you to mentor me
28th Nov 2017, 4:25 AM
michael ahianyo
michael ahianyo - avatar