Highlighted

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

New Here ,
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.

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

Views

27

Likes

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

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

New Here ,
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.

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

Views

28

Likes

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
Oct 16, 2020 0
New Here ,
Oct 16, 2020

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Oct 16, 2020 0