Warning: mysqli::mysqli() expects parameter 1 to be string,
Jeg for følgende fejlmeddelser kan i fortælle mig hvad jeg gør galt ?Warning: mysqli::mysqli() expects parameter 1 to be string, object given in /var/www/hold-ud.dk/public_html/katinka/header.php on line 14
Warning: mysqli::query() [mysqli.query]: Couldn't fetch mysqli in /var/www/hold-ud.dk/public_html/katinka/header.php on line 20
E-mail og kodeord passer ikke sammen
<?php
include('config.php');
if (!isset($_POST['submit'])){
$username = $_POST['username'];
$password = $_POST['password'];
echo $username or $password;
$mysqli = new mysqli($conn);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `users` WHERE `username` = '$username' AND `password` = '$password' LIMIT 1";
$result = $mysqli->query($sql);
if (!$result->num_rows == 1) {
echo "<p>E-mail og kodeord passer ikke sammen</p>";
} else {
echo "<p>Det lykkedes at logge ind</p>";
// do stuffs
}
}
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Katinka v 2.0</title>
<meta http-equiv="content-type" content="charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div id="topmenu">
<div id="login">
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
<a class="opretbruger" href="opret.php">Opret bruger</a>
<input id="username" type="text" name="username" value="E-mail" />
<input id="password" type="password" name="password" value="Kodeord" />
<input name="submit" type="submit" value=" Login " />
</form>
</div>
</div>
<div id="indholdcontainer">
<div id="headercontainer">
<img src="css/images/logony.png" alt="" />
</div>
<div id="menu">
<a class="menu" href="index.php">Forside</a>
<a class="menu" href="produkter.php">Produkter</a>
</div>
<div id="indhold">