Answers for "php echo post"

PHP
0

get all post values in php

//Loop all POST values.
foreach ($_POST as $key => $value) {
    echo "Field ".htmlspecialchars($key)." is ".htmlspecialchars($value)."<br>";
}
Posted by: Guest on August-08-2020
8

php post

<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'];
}
?>
Posted by: Guest on June-16-2020

Browse Popular Code Answers by Language