Processing HTML FORM
Author:- Subhasis
CMC
The form code looks as like below
Output of the code will be
html form tags
Form Tags                                                Output

<input type = "text" name = "name"/>

<inp...
Main form tag


• Method =“post” – This is the way of processing our user
  filled data into the form. Instead of „POST‟ w...
Continue

• When we process the form the html sends the data to file which is in
  action tag. Here when the form will pro...
PHP code to get the form values
• In PHP the $_GET,$_POST & $_REQUEST are
  special array in PHP.
• It collect the informa...
Checking the Special array $_POST
• Step -1 :- write the html file with form as below.
                                 Ne...
Continue ….
• Step – 2 :- writing the php file “test.php”
What is $_POST,$_GET & $_REQUEST ?
• There are three special global arrays in PHP.
 ▫ $_POST
 ▫ $_GET
 ▫ $_REQUEST
• When ...
Cont’d……
• $_GET is not secured .
• $_GET is not capable to send large amount of
  data
• $_POST is secured and able to se...
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....
An example(form code)
PHP code to process
Form validation
Upcoming SlideShare
Loading in …5
×

Php, mysq lpart4(processing html form)

1,284
-1

Published on

how to gwhow to validate php form

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,284
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Php, mysq lpart4(processing html form)

  1. 1. Processing HTML FORM Author:- Subhasis CMC
  2. 2. The form code looks as like below
  3. 3. Output of the code will be
  4. 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. 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. 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. 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. 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
  9. 9. Continue …. • Step – 2 :- writing the php file “test.php”
  10. 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. 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. 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.
  13. 13. An example(form code)
  14. 14. PHP code to process
  15. 15. Form validation
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×