I'm starting with PHP and I'm having trouble sending it to the database, unfortunately I can not find the error, if anyone can help, I'm grateful.
HTML looks like this:
<form method="post" action="blog.php" >
<input style="font-family:'open sans',sans-serif;font-size:20px;color:#212121"type="text" name="titulo" placeholder="Título" required />
<br>
<input type="text" name="texto" placeholder="Texto" required />
<br>
<input style="background-color:red;color:white" type="submit" name="submit" value="enviar" />
</form>
And PHP like this:
<?php
$titulo = $_POST ['titulo'];
$texto = $_POST ['texto'];
$imagem = "imagem";
echo "$titulo";
$conexao = mysqli_connect("localhost", "root", "", "blog");
mysqli_query($conexao, "INSERT INTO postagens (titulo,texto,imagem) VALUES ('$titulo','$texto,'$imagem')");
echo "Sucesso";
?>
The name of the database is 'Blog' and the 'post' table.