+ 1
Warning: mysqli_query() expects parameter 1 to be mysqli, null given in /storage/emulated/legacy/htdocs/new/login-process.php o
7 Antworten
+ 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');
}
?>
0
I don't know what is actually wrong with it plus I Need urgent help
0
ok
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.');
};
?>
0
ok
0
thank you dear it worked
0
pls can I ask you to mentor me