Question : get all post values in php
Answered by : alexander-gudmundsson
//Loop all POST values.
foreach ($_POST as $key => $value) { echo "Field ".htmlspecialchars($key)." is ".htmlspecialchars($value)."<br>";
}
Source : | Last Update : Sat, 15 Aug 20
Question : php post
Answered by : andrew-lautenbach
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>"> Name: <input type="text" name="fname"> <input type="submit">
</form>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") { // do logic $name = $_POST['fname'];
}
?>
Source : | Last Update : Tue, 23 Jun 20
Question : get post php
Answered by : mathis
<?php
var = $_POST['var'];
echo var;
// YOUR METHOD IN HTML MUST BE IN POST
<form method="post"> <input type="text" name="var">
</form>
Source : | Last Update : Thu, 12 Aug 21
Question : get post in php
Answered by : mathis
$data = json_decode(file_get_contents('php://input'), true);
// you have all in an array
Source : | Last Update : Fri, 03 Sep 21