+ 2
How to collect form data?
how to collect a data of form when submitted.
4 Answers
+ 4
you need to use superglobals variable, like $_GET and $_POST, it depend or your form method
+ 2
Basically like this:
<?php
if(!isset($_POST["submit"])) {
echo '<form method="post" action="">';
echo '<input type="text" name="name" placeholder="enter your name">';
echo '<button type="submit" name="submit">Submit</button>';
echo '</form>';
} else {
echo "Hello ". $_POST["name"];
}
?>
+ 2
html form data
+ 1
đđđ