SlideShare a Scribd company logo
1 of 23
PHP ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Introduction ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Continued... ,[object Object],[object Object],[object Object]
Where To Start ,[object Object],[object Object],[object Object],[object Object]
Syntax PHP code is executed on the server, and the plain HTML result is sent to the browser. A PHP scripting block always starts with <?php and ends with ?>. A PHP scripting block can be placed anywhere in the document. On servers with shorthand support enabled you can start a scripting block with <? and end with ?>. For maximum compatibility, we recommend that you use the standard form (<?php) rather than the shorthand form. <?php ?>  A PHP file normally contains HTML tags, just like an HTML file, and some PHP scripting code.
Continued.. Below, we have an example of a simple PHP script which sends the text &quot;Hello World&quot; to the browser: <html> <body> <?php echo &quot;Hello World&quot;; ?> </body> </html>
Continued... Each code line in PHP must end with a semicolon. The semicolon is a separator and is used to distinguish one set of instructions from another. There are two basic statements to output text with PHP: echo and print. In the example above we have used the echo statement to output the text &quot;Hello World&quot;. Comments in PHP In PHP, we use // to make a single-line comment or /* and */ to make a large comment block.
Variables in PHP ,[object Object],Variables are used for storing a values, like text strings, numbers or arrays. When a variable is declared, it can be used over and over again in your script. All variables in PHP start with a  $ sign symbol . The correct way of declaring a variable in PHP: $var_name = value;
Naming Rules for Variables ,[object Object],A variable name must start with a letter or an underscore &quot;_&quot; A variable name can only contain alpha-numeric characters and underscores (a-z, A-Z, 0-9, and _ ) A variable name should not contain spaces. If a variable name is more than one word, it should be separated with an underscore ($my_string), or with capitalization ($myString)
String Variables in PHP String variables are used for values that contains characters. PHP script assigns the text &quot;Hello World&quot; to a string variable called $txt: <?php $txt=&quot;Hello World&quot;; echo $txt; ?>
Continued... The Concatenation Operator There is only one string operator in PHP. The concatenation operator (.)  is used to put two string values together. The strlen() function The strlen() function is used to return the length of a string. <?php echo strlen(&quot;Hello world!&quot;); ?>  ,[object Object],[object Object]
Continued... The strpos() function The strpos() function is used to search for character within a string. If a match is found, this function will return the position of the first match. If no match is found, it will return FALSE . <?php echo strpos(&quot;Hello world!&quot;,&quot;world&quot;); ?>  Output :  6 The position of the string &quot;world&quot; in our string is position 6. The reason that it is 6 (and not 7), is that the first position in the string is 0, and not 1.
PHP Operators ,[object Object],[object Object],[object Object],[object Object]
Conditional Statements In PHP we have the following conditional statements: if statement  - use this statement to execute some code only if a specified condition is true if...else statement  - use this statement to execute some code if a condition is true and another code if the condition is false if...elseif....else statement  - use this statement to select one of several blocks of code to be executed switch statement  - use this statement to select one of many blocks of code to be executed
PHP Arrays An array stores multiple values in one single variable. In PHP, there are three kind of arrays: Numeric array  - An array with a numeric index Associative array  - An array where each ID key is associated with a value Multidimensional array  - An array containing one or more arrays
PHP Looping ,[object Object],Loops execute a block of code a specified number of times, or while a specified condition is true. In PHP, we have the following looping statements: while  - loops through a block of code while a specified condition is true do...while  - loops through a block of code once, and then repeats the loop as long  as a specified condition is true for  - loops through a block of code a specified number of times foreach  - loops through a block of code for each element in an array
PHP Functions In PHP, there are more than 700 built-in functions. A function will be executed by a call to the function. You may call a function from anywhere within a page. Syntax function functionName() { code to be executed; }
Forms and User Input ,[object Object],The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input. PHP Form Handling The most important thing to notice when dealing with HTML forms and PHP is that any  form element in an HTML page will automatically be available to your PHP scripts.
Continued... Example The example below contains an HTML form with two input fields and a submit button: <html> <body> <form action=&quot;welcome.php&quot; method=&quot;post&quot;> Name: <input type=&quot;text&quot; name=&quot;fname&quot; /> Age: <input type=&quot;text&quot; name=&quot;age&quot; /> <input type=&quot;submit&quot; /> </form> </body> </html>
PHP $_GET Function The built-in $_GET function is used to collect values in a form with  method=&quot;get&quot;. Information sent from a form with the GET method is visible to everyone (it will be displayed in the browser's address bar) and has limits on the amount of information to send (max. 100 characters). Example <form action=&quot;welcome.php&quot; method=&quot;get&quot;> Name: <input type=&quot;text&quot; name=&quot;fname&quot; /> Age: <input type=&quot;text&quot; name=&quot;age&quot; /> <input type=&quot;submit&quot; /> </form>
Continued... ,[object Object],[object Object],[object Object]
PHP $_POST Function The built-in $_POST function is used to collect values in a form with method=&quot;post&quot;. Information sent from a form with the POST method is invisible to others and has no limits on the amount of information to send. Example <form action=&quot;welcome.php&quot; method=&quot;post&quot;> Name: <input type=&quot;text&quot; name=&quot;fname&quot; /> Age: <input type=&quot;text&quot; name=&quot;age&quot; /> <input type=&quot;submit&quot; /> </form>
Continued... When to use method=&quot;post&quot;? Information sent from a form with the POST method is invisible to others  and has no limits on the amount of information to send. The PHP $_REQUEST Function The PHP built-in $_REQUEST function contains the contents of both $_GET, $_POST, and $_COOKIE. The $_REQUEST function can be used to collect form data sent with both the GET and POST methods. x

More Related Content

What's hot (20)

PHP - Introduction to PHP Fundamentals
PHP -  Introduction to PHP FundamentalsPHP -  Introduction to PHP Fundamentals
PHP - Introduction to PHP Fundamentals
 
Php
PhpPhp
Php
 
Php mysql
Php mysqlPhp mysql
Php mysql
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
HTML
HTMLHTML
HTML
 
Php Tutorials for Beginners
Php Tutorials for BeginnersPhp Tutorials for Beginners
Php Tutorials for Beginners
 
PHP Loops and PHP Forms
PHP  Loops and PHP FormsPHP  Loops and PHP Forms
PHP Loops and PHP Forms
 
Php basics
Php basicsPhp basics
Php basics
 
Web Development Course: PHP lecture 1
Web Development Course: PHP lecture 1Web Development Course: PHP lecture 1
Web Development Course: PHP lecture 1
 
Php Presentation
Php PresentationPhp Presentation
Php Presentation
 
Php and MySQL
Php and MySQLPhp and MySQL
Php and MySQL
 
Html
HtmlHtml
Html
 
Php
PhpPhp
Php
 
Php forms
Php formsPhp forms
Php forms
 
Php
PhpPhp
Php
 
Php Tutorial
Php TutorialPhp Tutorial
Php Tutorial
 
PHP slides
PHP slidesPHP slides
PHP slides
 
Css Ppt
Css PptCss Ppt
Css Ppt
 
PHP Powerpoint -- Teach PHP with this
PHP Powerpoint -- Teach PHP with thisPHP Powerpoint -- Teach PHP with this
PHP Powerpoint -- Teach PHP with this
 
4.2 PHP Function
4.2 PHP Function4.2 PHP Function
4.2 PHP Function
 

Viewers also liked

Viewers also liked (6)

PHP Basic & Arrays
PHP Basic & ArraysPHP Basic & Arrays
PHP Basic & Arrays
 
Array in php
Array in phpArray in php
Array in php
 
03 Php Array String Functions
03 Php Array String Functions03 Php Array String Functions
03 Php Array String Functions
 
Php array
Php arrayPhp array
Php array
 
Php array
Php arrayPhp array
Php array
 
Php string function
Php string function Php string function
Php string function
 

Similar to Php (20)

Php
PhpPhp
Php
 
PHP Tutorials
PHP TutorialsPHP Tutorials
PHP Tutorials
 
PHP Tutorials
PHP TutorialsPHP Tutorials
PHP Tutorials
 
What Is Php
What Is PhpWhat Is Php
What Is Php
 
1336333055 php tutorial_from_beginner_to_master
1336333055 php tutorial_from_beginner_to_master1336333055 php tutorial_from_beginner_to_master
1336333055 php tutorial_from_beginner_to_master
 
Web development
Web developmentWeb development
Web development
 
Php tutorial(w3schools)
Php tutorial(w3schools)Php tutorial(w3schools)
Php tutorial(w3schools)
 
Php tutorialw3schools
Php tutorialw3schoolsPhp tutorialw3schools
Php tutorialw3schools
 
Php1
Php1Php1
Php1
 
Php
PhpPhp
Php
 
Php
PhpPhp
Php
 
Php
PhpPhp
Php
 
Php essentials
Php essentialsPhp essentials
Php essentials
 
Introduction to PHP.ppt
Introduction to PHP.pptIntroduction to PHP.ppt
Introduction to PHP.ppt
 
Php
PhpPhp
Php
 
Babitha5.php
Babitha5.phpBabitha5.php
Babitha5.php
 
Babitha5.php
Babitha5.phpBabitha5.php
Babitha5.php
 
Babitha5.php
Babitha5.phpBabitha5.php
Babitha5.php
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Php Basics
Php BasicsPhp Basics
Php Basics
 

More from Ajaigururaj R (18)

Chennai Guide
Chennai GuideChennai Guide
Chennai Guide
 
Chennai Guide
Chennai GuideChennai Guide
Chennai Guide
 
Chennai Guide
Chennai GuideChennai Guide
Chennai Guide
 
Year 2070
Year 2070Year 2070
Year 2070
 
CCNA presentation.
CCNA presentation.CCNA presentation.
CCNA presentation.
 
Survey
SurveySurvey
Survey
 
Quiz on heart
Quiz on heartQuiz on heart
Quiz on heart
 
Quiz in cancer
Quiz in cancerQuiz in cancer
Quiz in cancer
 
Quiz in cancer
Quiz in cancerQuiz in cancer
Quiz in cancer
 
Quiz
QuizQuiz
Quiz
 
Diabetes
DiabetesDiabetes
Diabetes
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Wordpress
Wordpress Wordpress
Wordpress
 
Sample app
Sample appSample app
Sample app
 
Opensource and openlearning
Opensource and openlearningOpensource and openlearning
Opensource and openlearning
 
work Chart
work Chart work Chart
work Chart
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
 
Web2 ppt
Web2 pptWeb2 ppt
Web2 ppt
 

Recently uploaded

Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesShubhangi Sonawane
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxNikitaBankoti2
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 

Recently uploaded (20)

Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 

Php

  • 1.
  • 2.
  • 3.
  • 4.
  • 5. Syntax PHP code is executed on the server, and the plain HTML result is sent to the browser. A PHP scripting block always starts with <?php and ends with ?>. A PHP scripting block can be placed anywhere in the document. On servers with shorthand support enabled you can start a scripting block with <? and end with ?>. For maximum compatibility, we recommend that you use the standard form (<?php) rather than the shorthand form. <?php ?> A PHP file normally contains HTML tags, just like an HTML file, and some PHP scripting code.
  • 6. Continued.. Below, we have an example of a simple PHP script which sends the text &quot;Hello World&quot; to the browser: <html> <body> <?php echo &quot;Hello World&quot;; ?> </body> </html>
  • 7. Continued... Each code line in PHP must end with a semicolon. The semicolon is a separator and is used to distinguish one set of instructions from another. There are two basic statements to output text with PHP: echo and print. In the example above we have used the echo statement to output the text &quot;Hello World&quot;. Comments in PHP In PHP, we use // to make a single-line comment or /* and */ to make a large comment block.
  • 8.
  • 9.
  • 10. String Variables in PHP String variables are used for values that contains characters. PHP script assigns the text &quot;Hello World&quot; to a string variable called $txt: <?php $txt=&quot;Hello World&quot;; echo $txt; ?>
  • 11.
  • 12. Continued... The strpos() function The strpos() function is used to search for character within a string. If a match is found, this function will return the position of the first match. If no match is found, it will return FALSE . <?php echo strpos(&quot;Hello world!&quot;,&quot;world&quot;); ?> Output : 6 The position of the string &quot;world&quot; in our string is position 6. The reason that it is 6 (and not 7), is that the first position in the string is 0, and not 1.
  • 13.
  • 14. Conditional Statements In PHP we have the following conditional statements: if statement - use this statement to execute some code only if a specified condition is true if...else statement - use this statement to execute some code if a condition is true and another code if the condition is false if...elseif....else statement - use this statement to select one of several blocks of code to be executed switch statement - use this statement to select one of many blocks of code to be executed
  • 15. PHP Arrays An array stores multiple values in one single variable. In PHP, there are three kind of arrays: Numeric array - An array with a numeric index Associative array - An array where each ID key is associated with a value Multidimensional array - An array containing one or more arrays
  • 16.
  • 17. PHP Functions In PHP, there are more than 700 built-in functions. A function will be executed by a call to the function. You may call a function from anywhere within a page. Syntax function functionName() { code to be executed; }
  • 18.
  • 19. Continued... Example The example below contains an HTML form with two input fields and a submit button: <html> <body> <form action=&quot;welcome.php&quot; method=&quot;post&quot;> Name: <input type=&quot;text&quot; name=&quot;fname&quot; /> Age: <input type=&quot;text&quot; name=&quot;age&quot; /> <input type=&quot;submit&quot; /> </form> </body> </html>
  • 20. PHP $_GET Function The built-in $_GET function is used to collect values in a form with method=&quot;get&quot;. Information sent from a form with the GET method is visible to everyone (it will be displayed in the browser's address bar) and has limits on the amount of information to send (max. 100 characters). Example <form action=&quot;welcome.php&quot; method=&quot;get&quot;> Name: <input type=&quot;text&quot; name=&quot;fname&quot; /> Age: <input type=&quot;text&quot; name=&quot;age&quot; /> <input type=&quot;submit&quot; /> </form>
  • 21.
  • 22. PHP $_POST Function The built-in $_POST function is used to collect values in a form with method=&quot;post&quot;. Information sent from a form with the POST method is invisible to others and has no limits on the amount of information to send. Example <form action=&quot;welcome.php&quot; method=&quot;post&quot;> Name: <input type=&quot;text&quot; name=&quot;fname&quot; /> Age: <input type=&quot;text&quot; name=&quot;age&quot; /> <input type=&quot;submit&quot; /> </form>
  • 23. Continued... When to use method=&quot;post&quot;? Information sent from a form with the POST method is invisible to others and has no limits on the amount of information to send. The PHP $_REQUEST Function The PHP built-in $_REQUEST function contains the contents of both $_GET, $_POST, and $_COOKIE. The $_REQUEST function can be used to collect form data sent with both the GET and POST methods. x