SlideShare a Scribd company logo
Course Instructor: Nisa Soomro 
Prog_nisa@quest.edu.pk 
nisa1207@gmail.com
 $_GET 
 $_POST 
 $_REQUEST 
2
 HTML forms are used to pass data to a server via different input controls. 
 All input controls are placed in between <form> and </form> 
Syntax 
<form action=“PagetoOpen ” method=“ ” > 
//input controls placed here 
</form> 
Method= GET or POST 
3
4
5 
<form method="post" action="" > 
First Name <input name="fname" type="text" /> <br /> 
Last Name <input name="lname" type="text" /> <br /> 
<input type="submit" value="Save" /> 
</form>
The GET Method 
 The GET method sends the encoded user information appended to the page request. 
The page and the encoded information are separated by the ? character. 
 The GET method is restricted to send upto 1024 characters only. 
 Never use GET method if you have password or other sensitive information to be sent 
to the server. 
 GET can't be used to send binary data, like images or word documents, to the server.
7 
POST Method 
 The POST method does not have any restriction on data size to be sent. 
 The POST method can be used to send ASCII as well as binary data. 
 The data sent by POST method goes through HTTP header so security depends on 
HTTP protocol. By using this method your information is secure.
 The predefined $_GET Variable use to collect values in a form with method=“get” 
information sent from a form with the GET method is visible to everyone (it will 
be displayed in the browser address bar ) and has limits on the amount of 
information to send. 
 $_GET Variable to collect form data ( the name of the form field will automatically 
be the keys in the $_GET array ) 
 $_GET[“name”]; 
 $_GET[“fname”]; 
 $_GET[“age”]; 
8
 The predefined $_POST Variable use to collect values in a form with 
method=“post” information sent from a form with the POST method is invisible to 
other and has no limits on the amount of information to send. 
 Note: there is an 8MB max size for the POST Method , by default (can be changed 
by setting the post_max_size in the php.ini file ) 
 $_POST Variable to collect form data ( the name of the form field will 
automatically be the keys in the $_POST array ) 
 $_POST[“name”]; 
 $_POST[“fname”]; 
 $_POST[“age”]; 
9
 The PHP $_REQUEST variable contains the contents of both 
$_GET, $_POST, and $_COOKIE. We will discuss $_COOKIE 
variable when we will explain about cookies. 
 The PHP $_REQUEST variable can be used to get the result from 
form data sent with both the GET and POST methods. 
 $_REQUEST[“name”]; 
 $_REQUEST[“fname”]; 
 $_REQUEST[“age”]; 
10
 Both GET and POST create an array (e.g. array( key => value, key2 => 
value2, key3 => value3, ...)). This array holds key/value pairs, where keys 
are the names of the form controls and values are the input data from the 
user. 
 Both GET and POST are treated as $_GET and $_POST. These are 
superglobals, which means that they are always accessible, regardless of 
scope - and you can access them from any function, class or file without 
having to do anything special. 
 $_GET is an array of variables passed to the current script via the URL 
parameters. 
 $_POST is an array of variables passed to the current script via the HTTP 
POST method. 11
 Information sent from a form with the GET method is visible to everyone (all 
variable names and values are displayed in the URL). GET also has limits on the 
amount of information to send. The limitation is about 2000 characters. However, 
because the variables are displayed in the URL, it is possible to bookmark the 
page. This can be useful in some cases. 
 GET may be used for sending non-sensitive data. 
 Note: GET should NEVER be used for sending passwords or other sensitive 
information! 
12
 Information sent from a form with the POST method is invisible to others (all 
names/values are embedded within the body of the HTTP request) and has no 
limits on the amount of information to send. 
 Moreover POST supports advanced functionality such as support for multi-part 
binary input while uploading files to server. 
 However, because the variables are not displayed in the URL, it is not possible to 
bookmark the page. 
13
 www.w3school.com 
 http://www.tutorialspoint.com/php/index.htm 
 http://www.w3schools.com/php/php_ref_string.asp 
14

More Related Content

What's hot

PHP
PHPPHP
MYSQL - PHP Database Connectivity
MYSQL - PHP Database ConnectivityMYSQL - PHP Database Connectivity
MYSQL - PHP Database Connectivity
V.V.Vanniaperumal College for Women
 
Data types in php
Data types in phpData types in php
Data types in phpilakkiya
 
Php string function
Php string function Php string function
Php string function
Ravi Bhadauria
 
4.2 PHP Function
4.2 PHP Function4.2 PHP Function
4.2 PHP Function
Jalpesh Vasa
 
PHP - Introduction to PHP Forms
PHP - Introduction to PHP FormsPHP - Introduction to PHP Forms
PHP - Introduction to PHP Forms
Vibrant Technologies & Computers
 
PHP - Introduction to File Handling with PHP
PHP -  Introduction to  File Handling with PHPPHP -  Introduction to  File Handling with PHP
PHP - Introduction to File Handling with PHP
Vibrant Technologies & Computers
 
Class 3 - PHP Functions
Class 3 - PHP FunctionsClass 3 - PHP Functions
Class 3 - PHP Functions
Ahmed Swilam
 
PHP Functions & Arrays
PHP Functions & ArraysPHP Functions & Arrays
PHP Functions & Arrays
Henry Osborne
 
PHP variables
PHP  variablesPHP  variables
PHP variables
Siddique Ibrahim
 
Ajax ppt - 32 slides
Ajax ppt - 32 slidesAjax ppt - 32 slides
Ajax ppt - 32 slides
Smithss25
 
PHP Loops and PHP Forms
PHP  Loops and PHP FormsPHP  Loops and PHP Forms
PHP Loops and PHP Forms
M.Zalmai Rahmani
 
PHP - Introduction to PHP Fundamentals
PHP -  Introduction to PHP FundamentalsPHP -  Introduction to PHP Fundamentals
PHP - Introduction to PHP Fundamentals
Vibrant Technologies & Computers
 
Php and MySQL
Php and MySQLPhp and MySQL
Php and MySQL
Tiji Thomas
 
PHP - Introduction to PHP AJAX
PHP -  Introduction to PHP AJAXPHP -  Introduction to PHP AJAX
PHP - Introduction to PHP AJAX
Vibrant Technologies & Computers
 
Php database connectivity
Php database connectivityPhp database connectivity

What's hot (20)

PHP
PHPPHP
PHP
 
MYSQL - PHP Database Connectivity
MYSQL - PHP Database ConnectivityMYSQL - PHP Database Connectivity
MYSQL - PHP Database Connectivity
 
Data types in php
Data types in phpData types in php
Data types in php
 
Php string function
Php string function Php string function
Php string function
 
4.2 PHP Function
4.2 PHP Function4.2 PHP Function
4.2 PHP Function
 
Php mysql ppt
Php mysql pptPhp mysql ppt
Php mysql ppt
 
PHP - Introduction to PHP Forms
PHP - Introduction to PHP FormsPHP - Introduction to PHP Forms
PHP - Introduction to PHP Forms
 
PHP - Introduction to File Handling with PHP
PHP -  Introduction to  File Handling with PHPPHP -  Introduction to  File Handling with PHP
PHP - Introduction to File Handling with PHP
 
Class 3 - PHP Functions
Class 3 - PHP FunctionsClass 3 - PHP Functions
Class 3 - PHP Functions
 
PHP Functions & Arrays
PHP Functions & ArraysPHP Functions & Arrays
PHP Functions & Arrays
 
PHP variables
PHP  variablesPHP  variables
PHP variables
 
Ajax ppt - 32 slides
Ajax ppt - 32 slidesAjax ppt - 32 slides
Ajax ppt - 32 slides
 
PHP Loops and PHP Forms
PHP  Loops and PHP FormsPHP  Loops and PHP Forms
PHP Loops and PHP Forms
 
PHP - Introduction to PHP Fundamentals
PHP -  Introduction to PHP FundamentalsPHP -  Introduction to PHP Fundamentals
PHP - Introduction to PHP Fundamentals
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Php and MySQL
Php and MySQLPhp and MySQL
Php and MySQL
 
Php
PhpPhp
Php
 
PHP - Introduction to PHP AJAX
PHP -  Introduction to PHP AJAXPHP -  Introduction to PHP AJAX
PHP - Introduction to PHP AJAX
 
Php database connectivity
Php database connectivityPhp database connectivity
Php database connectivity
 
Control Structures In Php 2
Control Structures In Php 2Control Structures In Php 2
Control Structures In Php 2
 

Viewers also liked

Session & Cookies
Session & CookiesSession & Cookies
Android session 2-behestee
Android session 2-behesteeAndroid session 2-behestee
Android session 2-behestee
Hussain Behestee
 
Dalvik Source Code Reading
Dalvik Source Code ReadingDalvik Source Code Reading
Dalvik Source Code Reading
kishima7
 
Android Life Cycle
Android Life CycleAndroid Life Cycle
Android Life Cycle
mssaman
 
Android life cycle
Android life cycleAndroid life cycle
Android life cycle瑋琮 林
 
PHP Cookies and Sessions
PHP Cookies and SessionsPHP Cookies and Sessions
PHP Cookies and Sessions
Nisa Soomro
 
Android Studio NDK(JNI) + OpenCV 完整教學
Android Studio NDK(JNI) + OpenCV 完整教學Android Studio NDK(JNI) + OpenCV 完整教學
Android Studio NDK(JNI) + OpenCV 完整教學
Wei-Xiang Wang
 
Android: Intent, Intent Filter, Broadcast Receivers
Android: Intent, Intent Filter, Broadcast ReceiversAndroid: Intent, Intent Filter, Broadcast Receivers
Android: Intent, Intent Filter, Broadcast Receivers
CodeAndroid
 
Android Lesson 3 - Intent
Android Lesson 3 - IntentAndroid Lesson 3 - Intent
Android Lesson 3 - Intent
Daniela Da Cruz
 
Android - Broadcast Receiver
Android - Broadcast ReceiverAndroid - Broadcast Receiver
Android - Broadcast Receiver
Yong Heui Cho
 
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental pluginMastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Xavier Hallade
 

Viewers also liked (12)

Session & Cookies
Session & CookiesSession & Cookies
Session & Cookies
 
Android session 2-behestee
Android session 2-behesteeAndroid session 2-behestee
Android session 2-behestee
 
Dalvik Source Code Reading
Dalvik Source Code ReadingDalvik Source Code Reading
Dalvik Source Code Reading
 
Android Life Cycle
Android Life CycleAndroid Life Cycle
Android Life Cycle
 
Android life cycle
Android life cycleAndroid life cycle
Android life cycle
 
PHP Cookies and Sessions
PHP Cookies and SessionsPHP Cookies and Sessions
PHP Cookies and Sessions
 
Android intents
Android intentsAndroid intents
Android intents
 
Android Studio NDK(JNI) + OpenCV 完整教學
Android Studio NDK(JNI) + OpenCV 完整教學Android Studio NDK(JNI) + OpenCV 完整教學
Android Studio NDK(JNI) + OpenCV 完整教學
 
Android: Intent, Intent Filter, Broadcast Receivers
Android: Intent, Intent Filter, Broadcast ReceiversAndroid: Intent, Intent Filter, Broadcast Receivers
Android: Intent, Intent Filter, Broadcast Receivers
 
Android Lesson 3 - Intent
Android Lesson 3 - IntentAndroid Lesson 3 - Intent
Android Lesson 3 - Intent
 
Android - Broadcast Receiver
Android - Broadcast ReceiverAndroid - Broadcast Receiver
Android - Broadcast Receiver
 
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental pluginMastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
 

Similar to Form Handling using PHP

Form handling in php
Form handling in phpForm handling in php
Form handling in php
Fahad Khan
 
Lecture7 form processing by okello erick
Lecture7 form processing by okello erickLecture7 form processing by okello erick
Lecture7 form processing by okello erick
okelloerick
 
Making web forms using php
Making web forms using phpMaking web forms using php
Making web forms using php
krishnapriya Tadepalli
 
forms.pptx
forms.pptxforms.pptx
forms.pptx
asmabagersh
 
PHP-Part4
PHP-Part4PHP-Part4
PHP-Part4
Ahmed Saihood
 
Web app development_php_07
Web app development_php_07Web app development_php_07
Web app development_php_07Hassen Poreya
 
Get and post methods in php - phpgurukul
Get and post methods in php  - phpgurukulGet and post methods in php  - phpgurukul
Get and post methods in php - phpgurukul
PHPGurukul Blog
 
Working with data.pptx
Working with data.pptxWorking with data.pptx
Working with data.pptx
SherinRappai
 
Chapter 07 php forms handling
Chapter 07   php forms handlingChapter 07   php forms handling
Chapter 07 php forms handling
Dhani Ahmad
 
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
Naveen Kumar Veligeti
 
Web Technologies - forms and actions
Web Technologies -  forms and actionsWeb Technologies -  forms and actions
Web Technologies - forms and actionsAren Zomorodian
 
Parameter Passing & Session Tracking in PHP
Parameter Passing & Session Tracking in PHPParameter Passing & Session Tracking in PHP
Parameter Passing & Session Tracking in PHP
amichoksi
 
Introduction to web development - HTML 5
Introduction to web development - HTML 5Introduction to web development - HTML 5
Introduction to web development - HTML 5
Ayoub Ghozzi
 
Common Gateway Interface
Common Gateway InterfaceCommon Gateway Interface
Common Gateway Interface
Balu Masulkar
 
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
Mohd Harris Ahmad Jaal
 

Similar to Form Handling using PHP (20)

Form handling in php
Form handling in phpForm handling in php
Form handling in php
 
Lecture7 form processing by okello erick
Lecture7 form processing by okello erickLecture7 form processing by okello erick
Lecture7 form processing by okello erick
 
Making web forms using php
Making web forms using phpMaking web forms using php
Making web forms using php
 
GET and POST in PHP
GET and POST in PHPGET and POST in PHP
GET and POST in PHP
 
forms.pptx
forms.pptxforms.pptx
forms.pptx
 
PHP-Part4
PHP-Part4PHP-Part4
PHP-Part4
 
Web app development_php_07
Web app development_php_07Web app development_php_07
Web app development_php_07
 
Get and post methods in php - phpgurukul
Get and post methods in php  - phpgurukulGet and post methods in php  - phpgurukul
Get and post methods in php - phpgurukul
 
PHP Making Web Forms
PHP Making Web FormsPHP Making Web Forms
PHP Making Web Forms
 
Working with data.pptx
Working with data.pptxWorking with data.pptx
Working with data.pptx
 
Chapter 07 php forms handling
Chapter 07   php forms handlingChapter 07   php forms handling
Chapter 07 php forms handling
 
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
 
Http and security
Http and securityHttp and security
Http and security
 
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
 
Get and post methods
Get and post methodsGet and post methods
Get and post methods
 
Web Technologies - forms and actions
Web Technologies -  forms and actionsWeb Technologies -  forms and actions
Web Technologies - forms and actions
 
Parameter Passing & Session Tracking in PHP
Parameter Passing & Session Tracking in PHPParameter Passing & Session Tracking in PHP
Parameter Passing & Session Tracking in PHP
 
Introduction to web development - HTML 5
Introduction to web development - HTML 5Introduction to web development - HTML 5
Introduction to web development - HTML 5
 
Common Gateway Interface
Common Gateway InterfaceCommon Gateway Interface
Common Gateway Interface
 
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
 

More from Nisa Soomro

Connecting to my sql using PHP
Connecting to my sql using PHPConnecting to my sql using PHP
Connecting to my sql using PHP
Nisa Soomro
 
Basic of PHP
Basic of PHPBasic of PHP
Basic of PHP
Nisa Soomro
 
PHP Filing
PHP Filing PHP Filing
PHP Filing
Nisa Soomro
 
Html5
Html5Html5
HTML Basic Tags
HTML Basic Tags HTML Basic Tags
HTML Basic Tags
Nisa Soomro
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
Nisa Soomro
 
HTML Frameset & Inline Frame
HTML Frameset & Inline FrameHTML Frameset & Inline Frame
HTML Frameset & Inline Frame
Nisa Soomro
 
HTML Images
HTML Images HTML Images
HTML Images
Nisa Soomro
 
HTML Lists & Llinks
HTML Lists & LlinksHTML Lists & Llinks
HTML Lists & Llinks
Nisa Soomro
 
HTML Tables
HTML TablesHTML Tables
HTML Tables
Nisa Soomro
 
Html5 Canvas Detail
Html5 Canvas DetailHtml5 Canvas Detail
Html5 Canvas DetailNisa Soomro
 
Html5 canvas
Html5 canvasHtml5 canvas
Html5 canvas
Nisa Soomro
 
Html5
Html5Html5
Web programming lec#3
Web programming lec#3Web programming lec#3
Web programming lec#3Nisa Soomro
 

More from Nisa Soomro (16)

Connecting to my sql using PHP
Connecting to my sql using PHPConnecting to my sql using PHP
Connecting to my sql using PHP
 
Basic of PHP
Basic of PHPBasic of PHP
Basic of PHP
 
PHP Filing
PHP Filing PHP Filing
PHP Filing
 
Html5
Html5Html5
Html5
 
HTML Basic Tags
HTML Basic Tags HTML Basic Tags
HTML Basic Tags
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
HTML Frameset & Inline Frame
HTML Frameset & Inline FrameHTML Frameset & Inline Frame
HTML Frameset & Inline Frame
 
HTML Images
HTML Images HTML Images
HTML Images
 
HTML Lists & Llinks
HTML Lists & LlinksHTML Lists & Llinks
HTML Lists & Llinks
 
HTML Tables
HTML TablesHTML Tables
HTML Tables
 
Html5 SVG
Html5 SVGHtml5 SVG
Html5 SVG
 
Html5 Canvas Detail
Html5 Canvas DetailHtml5 Canvas Detail
Html5 Canvas Detail
 
Html5 canvas
Html5 canvasHtml5 canvas
Html5 canvas
 
Html5
Html5Html5
Html5
 
Html
HtmlHtml
Html
 
Web programming lec#3
Web programming lec#3Web programming lec#3
Web programming lec#3
 

Recently uploaded

Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 

Recently uploaded (20)

Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 

Form Handling using PHP

  • 1. Course Instructor: Nisa Soomro Prog_nisa@quest.edu.pk nisa1207@gmail.com
  • 2.  $_GET  $_POST  $_REQUEST 2
  • 3.  HTML forms are used to pass data to a server via different input controls.  All input controls are placed in between <form> and </form> Syntax <form action=“PagetoOpen ” method=“ ” > //input controls placed here </form> Method= GET or POST 3
  • 4. 4
  • 5. 5 <form method="post" action="" > First Name <input name="fname" type="text" /> <br /> Last Name <input name="lname" type="text" /> <br /> <input type="submit" value="Save" /> </form>
  • 6. The GET Method  The GET method sends the encoded user information appended to the page request. The page and the encoded information are separated by the ? character.  The GET method is restricted to send upto 1024 characters only.  Never use GET method if you have password or other sensitive information to be sent to the server.  GET can't be used to send binary data, like images or word documents, to the server.
  • 7. 7 POST Method  The POST method does not have any restriction on data size to be sent.  The POST method can be used to send ASCII as well as binary data.  The data sent by POST method goes through HTTP header so security depends on HTTP protocol. By using this method your information is secure.
  • 8.  The predefined $_GET Variable use to collect values in a form with method=“get” information sent from a form with the GET method is visible to everyone (it will be displayed in the browser address bar ) and has limits on the amount of information to send.  $_GET Variable to collect form data ( the name of the form field will automatically be the keys in the $_GET array )  $_GET[“name”];  $_GET[“fname”];  $_GET[“age”]; 8
  • 9.  The predefined $_POST Variable use to collect values in a form with method=“post” information sent from a form with the POST method is invisible to other and has no limits on the amount of information to send.  Note: there is an 8MB max size for the POST Method , by default (can be changed by setting the post_max_size in the php.ini file )  $_POST Variable to collect form data ( the name of the form field will automatically be the keys in the $_POST array )  $_POST[“name”];  $_POST[“fname”];  $_POST[“age”]; 9
  • 10.  The PHP $_REQUEST variable contains the contents of both $_GET, $_POST, and $_COOKIE. We will discuss $_COOKIE variable when we will explain about cookies.  The PHP $_REQUEST variable can be used to get the result from form data sent with both the GET and POST methods.  $_REQUEST[“name”];  $_REQUEST[“fname”];  $_REQUEST[“age”]; 10
  • 11.  Both GET and POST create an array (e.g. array( key => value, key2 => value2, key3 => value3, ...)). This array holds key/value pairs, where keys are the names of the form controls and values are the input data from the user.  Both GET and POST are treated as $_GET and $_POST. These are superglobals, which means that they are always accessible, regardless of scope - and you can access them from any function, class or file without having to do anything special.  $_GET is an array of variables passed to the current script via the URL parameters.  $_POST is an array of variables passed to the current script via the HTTP POST method. 11
  • 12.  Information sent from a form with the GET method is visible to everyone (all variable names and values are displayed in the URL). GET also has limits on the amount of information to send. The limitation is about 2000 characters. However, because the variables are displayed in the URL, it is possible to bookmark the page. This can be useful in some cases.  GET may be used for sending non-sensitive data.  Note: GET should NEVER be used for sending passwords or other sensitive information! 12
  • 13.  Information sent from a form with the POST method is invisible to others (all names/values are embedded within the body of the HTTP request) and has no limits on the amount of information to send.  Moreover POST supports advanced functionality such as support for multi-part binary input while uploading files to server.  However, because the variables are not displayed in the URL, it is not possible to bookmark the page. 13
  • 14.  www.w3school.com  http://www.tutorialspoint.com/php/index.htm  http://www.w3schools.com/php/php_ref_string.asp 14