Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Oct 16, 2020 Oct 16, 2020

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.

257
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

New Here , Oct 16, 2020 Oct 16, 2020

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

Translate
New Here ,
Oct 16, 2020 Oct 16, 2020
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines