+ 1
Hey i make html form if user submit the form how i can i see their input
how to get their inputs after when they submitted the form
5 Answers
+ 5
To add to @Kartikey, if your form uses POST method:
<?php
print_r($_POST);
?>
And if your form uses GET method:
<?php
print_r($_GET);
?>
The print_r function will display all that were sent when the form data is submitted.
Hth, cmiiw
+ 4
Use PHP to store their input in a file or PHP with MySQL to store it in database
+ 4
<!DOCTYPEÂ HTML>
<html>Â Â
<body>
<form action="welcome.php"method="get">
Name: <input type="text"name="name"><br>
E-mail: <input type="text"name="email"><br>
<input type="submit">
</form>
</body>
</html>
welcome.php
<html>
<body>
Welcome <?php echo $_GET["name"]; ?><br>
Your email address is: <?php echo $_GET["email"]; ?>
</body>
</html>
+ 4
And to save
<?php
$email = $_GET['email'];
$myfile = fopen("newfile.txt", "w") or die("Unable to open file!");
fwrite($myfile, $email); $email is what you'll save
fclose($myfile);
?>
+ 1
give example if you have