Skip to main content
Participant
October 16, 2020
Answered

{"code":"MethodNotAllowedError","message":"POST is not allowed"}

  • October 16, 2020
  • 1 reply
  • 241 views

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.

    This topic is closed to new replies. Start a new post to keep the conversation going.
    Correct answer Romulo5CC9

    Is ok now. Im using the web host server. The localhost server of xampp and vertrigo server give this problems.

    1 reply

    Romulo5CC9AuthorCorrect answer
    Participant
    October 16, 2020

    Is ok now. Im using the web host server. The localhost server of xampp and vertrigo server give this problems.