SlideShare a Scribd company logo
AIMS AND OBJECTIVES
Web Server Scripting
• Create a form in PHP
• Transfer data to another page using PHP
Web Server Scripting
Server Side Languages
PHP RECAP
<? php
Code
?>
Web Server Scripting
Server Side Languages
PHP RECAP
Variables
$x = 0; // sets up a variable
Web Server Scripting
Server Side Languages
Creating a form:
You do this in normal HTML code (but
still save it as a PHP page). Look at the
handout sheet for the form.
Web Server Scripting
Server Side Languages
When you submit the form:
<form method="post" action="result.php">
The server looks for result.php
All the text boxes full of information are
turned into php variables
Web Server Scripting
Server Side Languages
On result .php…
For example the text box called
first_name
Becomes $_POST['first_name'];
You can then use that variable.
Web Server Scripting
Server Side Languages
$first_name = $_POST['first_name'];
Stores the first_name in a semi-
permanent variable called $first_name.
You can then “echo” it or store it.
Web Server Scripting
Server Side Languages
On result.php
Echo $first_name.”<br>”;
Web Server Scripting
Server Side Languages
PHP – Forms
Passing Variables from a Form:
Welcome <?php echo $first_name; ?>!<br />
You are <?php echo $age; ?> years old.
Web Server Scripting
Server Side Languages
Use the handout to create form.php
And result.php which shows what has
been entered into the form.
Save in public_html
View at
Web Server Scripting
Extension:
Try using method=“GET” instead of
Method=“POST”
What is the difference?

More Related Content

What's hot (13)

Introducing thymeleaf
Introducing thymeleafIntroducing thymeleaf
Introducing thymeleaf
eiryu
 
PHP and PDFLib
PHP and PDFLibPHP and PDFLib
PHP and PDFLib
Adam Culp
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
F K
 
Wonka.js introduction
Wonka.js introductionWonka.js introduction
Wonka.js introduction
Julián Ceballos
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
irfan1008
 
20170310 PHP goal pyramid for memorising
20170310 PHP goal pyramid for memorising20170310 PHP goal pyramid for memorising
20170310 PHP goal pyramid for memorising
Sharon Liu
 
Ruby de Rails
Ruby de RailsRuby de Rails
Ruby de Rails
Yuichiro MASUI
 
Javascript debugging
Javascript debuggingJavascript debugging
Javascript debugging
audiodog
 
Php1
Php1Php1
Php1
mohamed yusuf
 
Sourcerer and Joomla! rev. 20130903
Sourcerer and Joomla! rev. 20130903Sourcerer and Joomla! rev. 20130903
Sourcerer and Joomla! rev. 20130903
DouglasPickett
 
HackU PHP and Node.js
HackU PHP and Node.jsHackU PHP and Node.js
HackU PHP and Node.js
souridatta
 
Mule xml parsing
Mule xml parsingMule xml parsing
Mule xml parsing
Muralidhar Gumma
 
Challenges of angular in production (Tasos Bekos) - GreeceJS #17
Challenges of angular in production (Tasos Bekos) - GreeceJS #17Challenges of angular in production (Tasos Bekos) - GreeceJS #17
Challenges of angular in production (Tasos Bekos) - GreeceJS #17
GreeceJS
 
Introducing thymeleaf
Introducing thymeleafIntroducing thymeleaf
Introducing thymeleaf
eiryu
 
PHP and PDFLib
PHP and PDFLibPHP and PDFLib
PHP and PDFLib
Adam Culp
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
F K
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
irfan1008
 
20170310 PHP goal pyramid for memorising
20170310 PHP goal pyramid for memorising20170310 PHP goal pyramid for memorising
20170310 PHP goal pyramid for memorising
Sharon Liu
 
Javascript debugging
Javascript debuggingJavascript debugging
Javascript debugging
audiodog
 
Sourcerer and Joomla! rev. 20130903
Sourcerer and Joomla! rev. 20130903Sourcerer and Joomla! rev. 20130903
Sourcerer and Joomla! rev. 20130903
DouglasPickett
 
HackU PHP and Node.js
HackU PHP and Node.jsHackU PHP and Node.js
HackU PHP and Node.js
souridatta
 
Challenges of angular in production (Tasos Bekos) - GreeceJS #17
Challenges of angular in production (Tasos Bekos) - GreeceJS #17Challenges of angular in production (Tasos Bekos) - GreeceJS #17
Challenges of angular in production (Tasos Bekos) - GreeceJS #17
GreeceJS
 

Viewers also liked (8)

PHP - Introduction to PHP Forms
PHP - Introduction to PHP FormsPHP - Introduction to PHP Forms
PHP - Introduction to PHP Forms
Vibrant Technologies & Computers
 
Form Script
Form ScriptForm Script
Form Script
lotlot
 
Chapter 07 php forms handling
Chapter 07   php forms handlingChapter 07   php forms handling
Chapter 07 php forms handling
Dhani Ahmad
 
3 php forms
3 php forms3 php forms
3 php forms
hello8421
 
Php Form
Php FormPhp Form
Php Form
lotlot
 
Php forms
Php formsPhp forms
Php forms
Anne Lee
 
Form Processing In Php
Form Processing In PhpForm Processing In Php
Form Processing In Php
Harit Kothari
 
Login and Registration form using oop in php
Login and Registration form using oop in phpLogin and Registration form using oop in php
Login and Registration form using oop in php
herat university
 
Form Script
Form ScriptForm Script
Form Script
lotlot
 
Chapter 07 php forms handling
Chapter 07   php forms handlingChapter 07   php forms handling
Chapter 07 php forms handling
Dhani Ahmad
 
Php Form
Php FormPhp Form
Php Form
lotlot
 
Form Processing In Php
Form Processing In PhpForm Processing In Php
Form Processing In Php
Harit Kothari
 
Login and Registration form using oop in php
Login and Registration form using oop in phpLogin and Registration form using oop in php
Login and Registration form using oop in php
herat university
 
Ad

Similar to Web server scripting - Using a form (20)

LAB PHP Consolidated.ppt
LAB PHP Consolidated.pptLAB PHP Consolidated.ppt
LAB PHP Consolidated.ppt
YasirAhmad80
 
10_introduction_php.ppt
10_introduction_php.ppt10_introduction_php.ppt
10_introduction_php.ppt
GiyaShefin
 
introduction_php.ppt
introduction_php.pptintroduction_php.ppt
introduction_php.ppt
ArunKumar313658
 
10_introduction_php.ppt
10_introduction_php.ppt10_introduction_php.ppt
10_introduction_php.ppt
MercyL2
 
Send, pass, get variables with php, form, html & java script code
Send, pass, get variables with php, form, html & java script codeSend, pass, get variables with php, form, html & java script code
Send, pass, get variables with php, form, html & java script code
Noushadur Shoukhin
 
PHP and MySQL : Server Side Scripting For Web Development
PHP and MySQL : Server Side Scripting For Web DevelopmentPHP and MySQL : Server Side Scripting For Web Development
PHP and MySQL : Server Side Scripting For Web Development
Edureka!
 
PHP Basic
PHP BasicPHP Basic
PHP Basic
Yoeung Vibol
 
PHP
PHPPHP
PHP
sometech
 
WT_PHP_PART1.pdf
WT_PHP_PART1.pdfWT_PHP_PART1.pdf
WT_PHP_PART1.pdf
HambardeAtharva
 
PHP and MySQL.ppt
PHP and MySQL.pptPHP and MySQL.ppt
PHP and MySQL.ppt
ROGELIOVILLARUBIA
 
Php mysql
Php mysqlPhp mysql
Php mysql
Abu Bakar
 
Developing web applications
Developing web applicationsDeveloping web applications
Developing web applications
salissal
 
Phpbasics
PhpbasicsPhpbasics
Phpbasics
PrinceGuru MS
 
Php with my sql
Php with my sqlPhp with my sql
Php with my sql
husnara mohammad
 
Php Tutorial | Introduction Demo | Basics
 Php Tutorial | Introduction Demo | Basics Php Tutorial | Introduction Demo | Basics
Php Tutorial | Introduction Demo | Basics
Shubham Kumar Singh
 
Php My SQL Tutorial | beginning
Php My SQL Tutorial | beginningPhp My SQL Tutorial | beginning
Php My SQL Tutorial | beginning
CRM Manager | Developer @ Websoles Strategic Digital Solutions
 
Learning of Php and My SQL Tutorial | For Beginners
Learning of Php and My SQL Tutorial | For BeginnersLearning of Php and My SQL Tutorial | For Beginners
Learning of Php and My SQL Tutorial | For Beginners
Ratnesh Pandey
 
php app development 1
php app development 1php app development 1
php app development 1
barryavery
 
basics of php
 basics of php basics of php
basics of php
PRINCE KUMAR
 
Lecture14-Introduction to PHP-coding.pdf
Lecture14-Introduction to PHP-coding.pdfLecture14-Introduction to PHP-coding.pdf
Lecture14-Introduction to PHP-coding.pdf
IotenergyWater
 
LAB PHP Consolidated.ppt
LAB PHP Consolidated.pptLAB PHP Consolidated.ppt
LAB PHP Consolidated.ppt
YasirAhmad80
 
10_introduction_php.ppt
10_introduction_php.ppt10_introduction_php.ppt
10_introduction_php.ppt
GiyaShefin
 
10_introduction_php.ppt
10_introduction_php.ppt10_introduction_php.ppt
10_introduction_php.ppt
MercyL2
 
Send, pass, get variables with php, form, html & java script code
Send, pass, get variables with php, form, html & java script codeSend, pass, get variables with php, form, html & java script code
Send, pass, get variables with php, form, html & java script code
Noushadur Shoukhin
 
PHP and MySQL : Server Side Scripting For Web Development
PHP and MySQL : Server Side Scripting For Web DevelopmentPHP and MySQL : Server Side Scripting For Web Development
PHP and MySQL : Server Side Scripting For Web Development
Edureka!
 
Developing web applications
Developing web applicationsDeveloping web applications
Developing web applications
salissal
 
Php Tutorial | Introduction Demo | Basics
 Php Tutorial | Introduction Demo | Basics Php Tutorial | Introduction Demo | Basics
Php Tutorial | Introduction Demo | Basics
Shubham Kumar Singh
 
Learning of Php and My SQL Tutorial | For Beginners
Learning of Php and My SQL Tutorial | For BeginnersLearning of Php and My SQL Tutorial | For Beginners
Learning of Php and My SQL Tutorial | For Beginners
Ratnesh Pandey
 
php app development 1
php app development 1php app development 1
php app development 1
barryavery
 
Lecture14-Introduction to PHP-coding.pdf
Lecture14-Introduction to PHP-coding.pdfLecture14-Introduction to PHP-coding.pdf
Lecture14-Introduction to PHP-coding.pdf
IotenergyWater
 
Ad

Recently uploaded (20)

Data Validation and System Interoperability
Data Validation and System InteroperabilityData Validation and System Interoperability
Data Validation and System Interoperability
Safe Software
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization ProgramOracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training RoadblocksDown the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Shashikant Jagtap
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdfEdge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too LateKubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Anish Kumar
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean accountYour startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...
Matsushita Laboratory
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry ReportThe State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
SOFTTECHHUB
 
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
angelo60207
 
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdfCrypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
 
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
Safe Software
 
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdfcnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
AmirStern2
 
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
Edge AI and Vision Alliance
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdfHigh Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptxFIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Alliance
 
“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...
“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...
“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...
Edge AI and Vision Alliance
 
Data Validation and System Interoperability
Data Validation and System InteroperabilityData Validation and System Interoperability
Data Validation and System Interoperability
Safe Software
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization ProgramOracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training RoadblocksDown the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Shashikant Jagtap
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdfEdge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too LateKubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Anish Kumar
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean accountYour startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...
Matsushita Laboratory
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry ReportThe State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
SOFTTECHHUB
 
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
angelo60207
 
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdfCrypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
 
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
Safe Software
 
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdfcnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
AmirStern2
 
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
Edge AI and Vision Alliance
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdfHigh Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptxFIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Alliance
 
“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...
“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...
“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...
Edge AI and Vision Alliance
 

Web server scripting - Using a form

  • 1. AIMS AND OBJECTIVES Web Server Scripting • Create a form in PHP • Transfer data to another page using PHP
  • 2. Web Server Scripting Server Side Languages PHP RECAP <? php Code ?>
  • 3. Web Server Scripting Server Side Languages PHP RECAP Variables $x = 0; // sets up a variable
  • 4. Web Server Scripting Server Side Languages Creating a form: You do this in normal HTML code (but still save it as a PHP page). Look at the handout sheet for the form.
  • 5. Web Server Scripting Server Side Languages When you submit the form: <form method="post" action="result.php"> The server looks for result.php All the text boxes full of information are turned into php variables
  • 6. Web Server Scripting Server Side Languages On result .php… For example the text box called first_name Becomes $_POST['first_name']; You can then use that variable.
  • 7. Web Server Scripting Server Side Languages $first_name = $_POST['first_name']; Stores the first_name in a semi- permanent variable called $first_name. You can then “echo” it or store it.
  • 8. Web Server Scripting Server Side Languages On result.php Echo $first_name.”<br>”;
  • 9. Web Server Scripting Server Side Languages PHP – Forms Passing Variables from a Form: Welcome <?php echo $first_name; ?>!<br /> You are <?php echo $age; ?> years old.
  • 10. Web Server Scripting Server Side Languages Use the handout to create form.php And result.php which shows what has been entered into the form. Save in public_html View at
  • 11. Web Server Scripting Extension: Try using method=“GET” instead of Method=“POST” What is the difference?