0

How to make form in php?

php

19th Dec 2016, 9:38 AM
Gun Wardhan Aditya
Gun Wardhan Aditya - avatar
3 Réponses
+ 6
<form action="form.php" method="post"> Form 1: <input type="text" name="form1"><br> Form 2: <input type="text" name="form2"><br> <input type="submit"> </form> The form data is sent with the HTTP POST method. Let's say this is a contact form and to display the submitted data you could simply echo all the variables. The "form.php" could look something like this: Welcome<?php echo $_POST["name"]; ?><br> Your email address is: <?php echo $_POST["email"]; ?> The PHP superglobals $_GET and $_POST are used to collect form-data. by echo those two superglobals you can provide an answer to the data stated before. This is used all the time and really easy to do Hope this helped you on your quest. Dr.
19th Dec 2016, 9:51 AM
Tristan McCullen
Tristan McCullen - avatar
+ 5
all you need to do to link a drop-down menu and a form is to simply use the name: option[1], option[2]. the values in the brackets " [] " separates the options in the menu and the form. Let me know if the answer was unclear or that I simply answered something different entirely. Dr.
19th Dec 2016, 10:17 AM
Tristan McCullen
Tristan McCullen - avatar
0
I want to create menu entry form , if I select veg from drop down, appear a form for add product. how to make connection between drop down to form. please help me.
19th Dec 2016, 9:57 AM
Gun Wardhan Aditya
Gun Wardhan Aditya - avatar