+ 2

How to collect form data?

how to collect a data of form when submitted.

23rd Feb 2018, 12:57 PM
ANKIT YADAV
ANKIT YADAV - avatar
4 Answers
+ 4
you need to use superglobals variable, like $_GET and $_POST, it depend or your form method
23rd Feb 2018, 1:24 PM
ivan Pratama
ivan Pratama - avatar
+ 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"]; } ?>
23rd Feb 2018, 1:13 PM
Chrizzhigh
Chrizzhigh - avatar
+ 2
html form data
23rd Feb 2018, 1:16 PM
ANKIT YADAV
ANKIT YADAV - avatar
+ 1
😍😍😍
23rd Feb 2018, 1:12 PM
Gorla Anand Sai
Gorla Anand Sai - avatar