Answered
{"code":"MethodNotAllowedError","message":"POST is not allowed"}
I can't give any info to my database because of POST error.
Please which is the solution for this?
index.php
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>form mercado</title>
</head>
<body>
<h1>Cadastrar Usuário</h1>
<form method="POST" action="processa.php">
<label>Tarefa: </label>
<input type="text" name="tarefa"><br><br>
<label>Prioridade: </label>
<input type="number" name="numero"><br><br>
<input type="submit" value="Cadastrar">
</form>
</body>
</html>
conexao.php
<?php
$servidor = "localhost";
$usuario = "root";
$senha = "";
$dbname = "db1";
$conn = mysqli_connect($servidor, $usuario, $senha, $dbname);
processa.php
<?php
include_once("conexao.php");
$tarefa = filter_input(INPUT_POST, 'tarefa', FILTER_SANITIZE_STRING);
$numero = filter_input(INPUT_POST, 'numero', FILTER_SANITIZE_NUMBER_INT);
$result_mercado = "INSERT INTO mercado (tarefa, numero) VALUES ('$tarefa', '$numero')";
$resultado_mercado = mysql_query($conn, $result_mercado);
Thats the only 3 pages from in project.
