**Warning** : Undefined variable $conexao in **C:\xampp\htdocs\index.php** on line **11**
**Fatal error** : Uncaught TypeError: mysqli_query(): Argument #1 ($mysql) must be of type mysqli, null given in C:\xampp\htdocs\index.php:11 Stack trace: #0 C:\xampp\htdocs\index.php(11): mysqli_query(NULL, 'INSERT INTO use...') #1 {main} thrown in **C:\xampp\htdocs\index.php** on line **11**
Fica dando esse erro quando tento entrar no site. Esse e o codigo do site:
<?php
if (isset($_POST['submit'])) {
//print_r($_POST['User']);
//print_r('<br>');
//print_r($_POST['password']);
$name = $_POST['User'];
$password = $_POST['password'];
$result = mysqli_query($conexao, "INSERT INTO user(User,password) VALUES ('$name','$password')");
}
?>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login - Painel</title>
<style>
body {
font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
background-color:#1C1C1C;
}
div {
background-color: rgba(33, 33, 33, 5);
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: 50px;
border-radius: 13px;
color: whitesmoke;
}
input {
padding: 15px;
border: none;
outline: none;
font-size: 15px;
border-radius: 7px;
background-color: rgba(38, 38, 38, 9);
}
#submit {
background-color: dodgerblue;
border: none;
font-family: Georgia, 'Times New Roman', Times, serif;
padding: 15px;
font-size: medium;
width: 100%;
border-radius: 7px;
color: rgba(39, 39, 39, 5);
font-size: 15px;
}
#submit:hover {
background-color: rgb(2, 133, 255);
}
</style>
</head>
<body>
<div>
<form action="index.php" method="POST">
<h1>Login</h1>
<input type="text" name="User" placeholder="User">
<br><br>
<input type="password" name="password" placeholder="Senha">
<br><br>
<input type="submit" name="submit" id="submit">
</form>
</div>
</body>
</html>