SlideShare una empresa de Scribd logo
1 de 15
Descargar para leer sin conexión
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"/>

<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>
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.
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 .
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.
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
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 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.
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.
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.
An example(form code)
PHP code to process
Form validation

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

PHP Variables and scopes
PHP Variables and scopesPHP Variables and scopes
PHP Variables and scopes
 
php basics
php basicsphp basics
php basics
 
PHP Tutorials
PHP TutorialsPHP Tutorials
PHP Tutorials
 
Control Structures In Php 2
Control Structures In Php 2Control Structures In Php 2
Control Structures In Php 2
 
Dev traning 2016 basics of PHP
Dev traning 2016   basics of PHPDev traning 2016   basics of PHP
Dev traning 2016 basics of PHP
 
Web technology html5 php_mysql
Web technology html5 php_mysqlWeb technology html5 php_mysql
Web technology html5 php_mysql
 
Basics PHP
Basics PHPBasics PHP
Basics PHP
 
Phphacku iitd
Phphacku iitdPhphacku iitd
Phphacku iitd
 
Php Tutorial
Php TutorialPhp Tutorial
Php Tutorial
 
PHP Workshop Notes
PHP Workshop NotesPHP Workshop Notes
PHP Workshop Notes
 
PHP-Part4
PHP-Part4PHP-Part4
PHP-Part4
 
Php Unit 1
Php Unit 1Php Unit 1
Php Unit 1
 
Chapter 02 php basic syntax
Chapter 02   php basic syntaxChapter 02   php basic syntax
Chapter 02 php basic syntax
 
Using PHP
Using PHPUsing PHP
Using PHP
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Php
PhpPhp
Php
 
Php variables (english)
Php variables (english)Php variables (english)
Php variables (english)
 
Php a dynamic web scripting language
Php   a dynamic web scripting languagePhp   a dynamic web scripting language
Php a dynamic web scripting language
 
PHP-Part3
PHP-Part3PHP-Part3
PHP-Part3
 
Php
PhpPhp
Php
 

Destacado

Advanced php
Advanced phpAdvanced php
Advanced php
hamfu
 
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Jeremiah Grossman
 
Accessible dynamic forms
Accessible dynamic formsAccessible dynamic forms
Accessible dynamic forms
Dylan Barrell
 
RedHat-System Administration I - RH124
RedHat-System Administration I - RH124RedHat-System Administration I - RH124
RedHat-System Administration I - RH124
Nikola Tokić
 
Php Security Workshop
Php Security WorkshopPhp Security Workshop
Php Security Workshop
Aung Khant
 
LAMP Management with Virtualmin
LAMP Management with VirtualminLAMP Management with Virtualmin
LAMP Management with Virtualmin
Joe Ferguson
 
Effective communication
Effective communicationEffective communication
Effective communication
hussulinux
 

Destacado (20)

Advanced php
Advanced phpAdvanced php
Advanced php
 
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
 
jQuery: Events, Animation, Ajax
jQuery: Events, Animation, AjaxjQuery: Events, Animation, Ajax
jQuery: Events, Animation, Ajax
 
Cross platform php
Cross platform phpCross platform php
Cross platform php
 
PHP Advanced
PHP AdvancedPHP Advanced
PHP Advanced
 
Accessible dynamic forms
Accessible dynamic formsAccessible dynamic forms
Accessible dynamic forms
 
RedHat-System Administration I - RH124
RedHat-System Administration I - RH124RedHat-System Administration I - RH124
RedHat-System Administration I - RH124
 
Knolx j query-form-validation-slides
Knolx j query-form-validation-slidesKnolx j query-form-validation-slides
Knolx j query-form-validation-slides
 
Your Inner Sysadmin - Tutorial (SunshinePHP 2015)
Your Inner Sysadmin - Tutorial (SunshinePHP 2015)Your Inner Sysadmin - Tutorial (SunshinePHP 2015)
Your Inner Sysadmin - Tutorial (SunshinePHP 2015)
 
HTML5 & WAI-ARIA Forms with jQuery Validation
HTML5 & WAI-ARIA Forms with jQuery ValidationHTML5 & WAI-ARIA Forms with jQuery Validation
HTML5 & WAI-ARIA Forms with jQuery Validation
 
Php Security Workshop
Php Security WorkshopPhp Security Workshop
Php Security Workshop
 
PHP Security Tips
PHP Security TipsPHP Security Tips
PHP Security Tips
 
OWASP App Sec US - 2010
OWASP App Sec US - 2010OWASP App Sec US - 2010
OWASP App Sec US - 2010
 
Cinematic UX Design
Cinematic UX DesignCinematic UX Design
Cinematic UX Design
 
LAMP Management with Virtualmin
LAMP Management with VirtualminLAMP Management with Virtualmin
LAMP Management with Virtualmin
 
CSS3 and jQuery
CSS3 and jQueryCSS3 and jQuery
CSS3 and jQuery
 
PHP
PHPPHP
PHP
 
A brief look inside UML
A brief look inside UMLA brief look inside UML
A brief look inside UML
 
Effective communication
Effective communicationEffective communication
Effective communication
 
Apache Web Server Setup 2
Apache Web Server Setup 2Apache Web Server Setup 2
Apache Web Server Setup 2
 

Similar a Php, mysq lpart4(processing html form)

Lecture2_IntroductionToPHP_Spring2023.pdf
Lecture2_IntroductionToPHP_Spring2023.pdfLecture2_IntroductionToPHP_Spring2023.pdf
Lecture2_IntroductionToPHP_Spring2023.pdf
ShaimaaMohamedGalal
 
PHP fundamnetal in information technology CHapter -02.pptx
PHP fundamnetal in information technology CHapter -02.pptxPHP fundamnetal in information technology CHapter -02.pptx
PHP fundamnetal in information technology CHapter -02.pptx
worldchannel
 
J query post method in php
J query post method in phpJ query post method in php
J query post method in php
Samir Patel
 
Chapter 6 Getting Data from the Client (1).pptx
Chapter 6 Getting Data from the Client (1).pptxChapter 6 Getting Data from the Client (1).pptx
Chapter 6 Getting Data from the Client (1).pptx
AhmedKafi7
 
Web app development_php_07
Web app development_php_07Web app development_php_07
Web app development_php_07
Hassen Poreya
 

Similar a Php, mysq lpart4(processing html form) (20)

Working with data.pptx
Working with data.pptxWorking with data.pptx
Working with data.pptx
 
Php forms and validations by naveen kumar veligeti
Php forms and validations by naveen kumar veligetiPhp forms and validations by naveen kumar veligeti
Php forms and validations by naveen kumar veligeti
 
forms.pptx
forms.pptxforms.pptx
forms.pptx
 
PHP - Introduction to PHP Forms
PHP - Introduction to PHP FormsPHP - Introduction to PHP Forms
PHP - Introduction to PHP Forms
 
Lecture2_IntroductionToPHP_Spring2023.pdf
Lecture2_IntroductionToPHP_Spring2023.pdfLecture2_IntroductionToPHP_Spring2023.pdf
Lecture2_IntroductionToPHP_Spring2023.pdf
 
Lecture7 form processing by okello erick
Lecture7 form processing by okello erickLecture7 form processing by okello erick
Lecture7 form processing by okello erick
 
Php Tutorial
Php TutorialPhp Tutorial
Php Tutorial
 
Introduction to php web programming - get and post
Introduction to php  web programming - get and postIntroduction to php  web programming - get and post
Introduction to php web programming - get and post
 
Web Development Course: PHP lecture 2
Web Development Course: PHP lecture 2Web Development Course: PHP lecture 2
Web Development Course: PHP lecture 2
 
PHP fundamnetal in information technology CHapter -02.pptx
PHP fundamnetal in information technology CHapter -02.pptxPHP fundamnetal in information technology CHapter -02.pptx
PHP fundamnetal in information technology CHapter -02.pptx
 
Web Application Development using PHP Chapter 5
Web Application Development using PHP Chapter 5Web Application Development using PHP Chapter 5
Web Application Development using PHP Chapter 5
 
J query post method in php
J query post method in phpJ query post method in php
J query post method in php
 
Chapter 6 Getting Data from the Client (1).pptx
Chapter 6 Getting Data from the Client (1).pptxChapter 6 Getting Data from the Client (1).pptx
Chapter 6 Getting Data from the Client (1).pptx
 
GET and POST in PHP
GET and POST in PHPGET and POST in PHP
GET and POST in PHP
 
Web app development_php_07
Web app development_php_07Web app development_php_07
Web app development_php_07
 
PHP Basic
PHP BasicPHP Basic
PHP Basic
 
web2_lec6.pdf
web2_lec6.pdfweb2_lec6.pdf
web2_lec6.pdf
 
PHP-04-Forms.ppt
PHP-04-Forms.pptPHP-04-Forms.ppt
PHP-04-Forms.ppt
 
03-forms.ppt.pptx
03-forms.ppt.pptx03-forms.ppt.pptx
03-forms.ppt.pptx
 
Php Basics
Php BasicsPhp Basics
Php Basics
 

Más de Subhasis Nayak

Más de Subhasis Nayak (19)

Php, mysq lpart5(mysql)
Php, mysq lpart5(mysql)Php, mysq lpart5(mysql)
Php, mysq lpart5(mysql)
 
working with database using mysql
working with database using mysql working with database using mysql
working with database using mysql
 
Php, mysq lpart3
Php, mysq lpart3Php, mysq lpart3
Php, mysq lpart3
 
Jsp 01
Jsp 01Jsp 01
Jsp 01
 
Jsp 02(jsp directives)2003
Jsp 02(jsp directives)2003Jsp 02(jsp directives)2003
Jsp 02(jsp directives)2003
 
Php, mysqlpart2
Php, mysqlpart2Php, mysqlpart2
Php, mysqlpart2
 
C:\fakepath\jsp01
C:\fakepath\jsp01C:\fakepath\jsp01
C:\fakepath\jsp01
 
Servlet & jsp
Servlet  &  jspServlet  &  jsp
Servlet & jsp
 
J2ee connector architecture
J2ee connector architectureJ2ee connector architecture
J2ee connector architecture
 
how to create object
how to create objecthow to create object
how to create object
 
Pointer in c++ part3
Pointer in c++ part3Pointer in c++ part3
Pointer in c++ part3
 
Pointer in c++ part2
Pointer in c++ part2Pointer in c++ part2
Pointer in c++ part2
 
Pointer in c++ part1
Pointer in c++ part1Pointer in c++ part1
Pointer in c++ part1
 
C++ arrays part2
C++ arrays part2C++ arrays part2
C++ arrays part2
 
C++ arrays part1
C++ arrays part1C++ arrays part1
C++ arrays part1
 
Introduction to network
Introduction to networkIntroduction to network
Introduction to network
 
Flow control in c++
Flow control in c++Flow control in c++
Flow control in c++
 
Oops And C++ Fundamentals
Oops And C++ FundamentalsOops And C++ Fundamentals
Oops And C++ Fundamentals
 
Text mode Linux Installation Part 01
Text mode Linux Installation Part 01Text mode Linux Installation Part 01
Text mode Linux Installation Part 01
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 

Php, mysq lpart4(processing html form)

  • 2. The form code looks as like below
  • 3. Output of the code will be
  • 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
  • 9. Continue …. • Step – 2 :- writing the php file “test.php”
  • 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.
  • 14. PHP code to process