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

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

New Here ,
Oct 16, 2020 Oct 16, 2020

Copy link to clipboard

Copied

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.

Views

158

Translate

Translate

Report

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.

Votes

Translate

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

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

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