4. html form tags
Form Tags Output
<input type = "text" name = "name"/>
<input type="radio" name ="gender" value ="mâ/>
<input type="CHECKBOX" name="age" value ="Y" checked/>
<SELECT name = "education">
<option selected value=âpg">P.Graduate</option>
</SELECT>
<input type="submit" name="submit" value="submit">
<TEXTAREA name = "aboutu" rows ="5" cols ="28"
></TEXTAREA>
5. Main form tag
⢠Method =âpostâ â This is the way of processing our user
filled data into the form. Instead of âPOSTâ we can use
âGETâ.
⢠GET â when we use get method the data processed will
be visible. The amount of data is to be sent is limited
⢠POST â when we use POST method the data processed
will be not visible. The amount of data is to be sent is not
limited.
6. Continue
⢠When we process the form the html sends the data to file which is in
action tag. Here when the form will process it will sends to
âformfill.phpâ.
⢠We need some php code to get those values which will be sent by the
form tag .
⢠We have three types.
⍠$_GET = we used to get the values from html form when method is get
⍠$_POST = we used to get the values from html form when method is
post
⍠$_REUQEST = it works on both .
7. PHP code to get the form values
⢠In PHP the $_GET,$_POST & $_REQUEST are
special array in PHP.
⢠It collect the information which filed has collected
the values .
⢠Simply there is no value about the fields on which
there is no values entered by the user.
⢠To check that use the step by step tutorial. I will use
$_POST for this what ever you want you can refer
else you can refer what I am referring.
8. Checking the Special array $_POST
⢠Step -1 :- write the html file with form as below.
Next step is to write a
php code for processing,
the name will be in
action tag as below. Here
my php file name is
âtest.phpâ.
Letâs write that
10. What is $_POST,$_GET & $_REQUEST ?
⢠There are three special global arrays in PHP.
⍠$_POST
⍠$_GET
⍠$_REQUEST
⢠When ever you submit any data to get those
value you can use any one of the above array.
⢠$_POST is more robust than $_GET,
$_REQUEST is combined both of them.
11. ContâdâŚâŚ
⢠$_GET is not secured .
⢠$_GET is not capable to send large amount of
data
⢠$_POST is secured and able to send unlimited
amount of data.
⢠So $_POST is more preferable.
12. Letâs receive data sent by HTML form
⢠To fetch the data from form we have to specify
name for each element of the form.
⢠Once you do that any data you will send from
FORM it will be fetch by the special array
$_GET & $_POST.
⢠To reuse it you can store it to some variable and
do what ever else you want to do.