SlideShare a Scribd company logo
HTML
afm -INFO2301S1Y1314
FORMS
THE
Contents
 Relations between PHP and HTML forms
 Requirements for use of forms
 How form works
afm -INFO2301S1Y1314
The two important tasks in dynamic websites
I. Creating data
II. Processing Data
The relationships:
afm -INFO2301S1Y1314
Client-Server Interaction.
 Interaction between user and web application.
 Primary source of data (Client).
 Process data to cater business needs (records
keeping, financial report, application status, etc)
 HTML and Web scripting depend on each other to
form web application.
The importance of HTML forms
afm -INFO2301S1Y1314
 Knowledge in HTML.
 Strong foundation in Hypertext Markup Language is
a prerequisite.
 Knowing the HTML functions in the presentation
layer.
 Website design is central at HTML layer.
 Design and functionality should be balance in any
web application.
The importance of HTML forms
afm -INFO2301S1Y1314
The typical use of HTML forms
afm -INFO2301S1Y1314
 A form on a web page gathers input data from the user.
 The data the form controls varies e.g. buttons, text
fields, menus, etc.
 On the other hand the user's data is sent back to the
server where it is processed by web programming
languages, e.g. a PHP script
The functions of forms
afm -INFO2301S1Y1314
Example :
<html>
<form name:”fname” action =“input_dest.php” method=“post”>
<! - -
--- form inputs
- - >
</form>
<html>
 A form is an area that can contain form elements.
 Form elements are elements that allow the user to
enter information (like text fields, text area fields,
dropdown menus,radio buttons, checkboxes, etc.) in a
form.
 A form is defined with the <form> tag.
The functions of forms
afm -INFO2301S1Y1314
 An input form
 The most used form tag is the <input> tag.
 The type of input is specified with the type attribute.
 We will look at some of the most commonly used input
types.
 Text Field input
 Text fields are used when you want the user to type
letters, numbers, etc. in a form.
The functions of forms
afm -INFO2301S1Y1314
Example :
<form>
First name:
<input type="text" name="firstname"> <br>
Last name:
<input type="text" name="lastname">
</form>
 Radio Buttons
 Radio Buttons are used when you want the
user to select one of a limited number of
choices.
The functions of forms
afm -INFO2301S1Y1314
Example :
<form>
<input type="radio" name="sex“
value="male"> Male <br>
<input type="radio" name="sex" value="female">
Female
</form>
 Checkboxes
 Checkboxes are used when you want the user to
select one or more options of a limited number of
choices.
The functions of forms
afm -INFO2301S1Y1314
Example :
<form>
I have a bike: <input type="checkbox" name="vehicle"
value="Bike“> <br>
I have a car: <input type="checkbox" name="vehi cle"
value="Car“> <br>
I have an airplane: <input type="checkbox“ ame="vehicle"
value="Airplane
</form>
 Submit Buttons
 To be useful, a form will contain a submit button, which
the user can press to send the data to the server (or
whatever)
 Use an input element with attribute type="submit“.
 By default, the button has Submit Query written on it but
you can supply our own label using the value attribute.
The functions of forms
afm -INFO2301S1Y1314
Example :
<form>
<input type=“submit“ ></br>
<input type=“submit" value=“HANTAR" />
</form>
 The Form's Action Attribute and the Submit Button
 When the user clicks on the "Submit" button, the content of the form
is sent to the server.
 The form element has two attributes: action and method.
 The form's action attribute defines the name of the file to send the
content to.
 The file defined in the action attribute usually does something with the
received input.
The functions of forms
afm -INFO2301S1Y1314
Example :
<form>
name=“formName" action="html_form_submit.php“
method="get">
Username:
<input type="text" name="user">
<input type="submit" value=“submit">
</form>
 Reset button
 A form might contain a reset button, which the user
can press to clear the data s/he has typed
 Use an input element with attribute type="reset“.
 By default, the button has Reset written on it but
you can supply your own label using the value
attribute:
The functions of forms
afm -INFO2301S1Y1314
Example :
<form>
<input type="text" name="user">
<input type=“reset" value=“padam">
</form>
1. START with the HTML <form> tag
2. ACTION attribute of the <form> tag is the URL of
the PHP script that ill process the input data from the
form
3. METHOD on how to process the input data
i. GET (Default) = appends the form-data to the URL
in name/value pairs: RL?name=value&name=value
ii. POST = Sends the form-data as an HTTP post
transaction
4. CREATE the form with buttons, boxes, and others
using HTML tags and fields
5. SUBMIT button so that the form can be processed
6. END the form with the </form> tag. End the HTML
document with the </html> tag
Steps to make web forms
afm -INFO2301S1Y1314
<html>
<body>
<form name="input" action="html_form_action.php" method="get">
Type your first name:
<input type="text" name="FirstName" value="Mickey" size=“20”><br>
Type your last name:
<input type="text" name="LastName" value="Mouse" size=“20“><br>
<input type="radio" name="sex" value="male"> Male <br>
<input type="radio" name="sex" value="female"> Female
I have a bike: <input type="checkbox" name="vehicle" value="Bike“><br>
I have a car: <input type="checkbox" name="vehicle" value="Car"> <br>
<input type="submit" value="Submit">
</form>
<p>
If you click the "Submit" button, you will send your input to a new page called
html_form_action.php.
</p>
</body>
</html>
Steps to make web forms
afm -INFO2301S1Y1314
 When the user presses submit...
 When the submit button is pressed, the browser
arranges the data in name/value pairs
How a form works
afm -INFO2301S1Y1314
Example :
<form>
name=“formName" action="html_form_submit.php“
method="get">
Username:
<input type="text" name="username"> <-- user type mickey->
<input type="text" name=“surname"> <-- user type mouse->
<input type="submit" value=“submit">
</form>
 ..what happens in between the form & the server is ..
The data arranged in name/value pairs, behind the scenes
the browser also encodes the data using standard URL
encoding:
This replaces spaces, slashes and other chars that are not
allowed in URLs by their hexadecimal equivalents
 example 1: spaces are replaced by %20 (which may
display as '+'); slashes by %2F
Example 2: the user types Mickey and O Mouse into the
form The data is arranged and encoded as follows
firstname=Mickey&surname=O%20Mouse
How a form works
afm -INFO2301S1Y1314
 ..in the end at the server is ..
After the data is encoded, the browser creates an
HTTP request
 the command (method) is given by the method
attribute the URL is given by the action attribute if
method="get", the data is added to the end of the
URL after a question mark,
 e.g.: GET
process.php?firstname=Mickey&surname=Mouse
How a form works
afm -INFO2301S1Y1314
 an illustration..
How a form works
afm -INFO2301S1Y1314
 Notes on POST and GET methods
 Notes on GET:
 Appends form-data into the URL in name/value pairs
 The length of a URL is limited (about 3000 characters)
 Never use GET to send sensitive data! (will be visible in the
URL)
 Useful for form submissions where a user want to bookmark the
result
 GET is better for non-secure data, like query strings in Google
 Notes on POST:
 Appends form-data inside the body of the HTTP request (data is
not shown is in URL)
 Has no size limitations
 Form submissions with POST cannot be bookmarked
How a form works
afm -INFO2301S1Y1314
 Which method we need in form?
 GET
 The default method GET
 sends submitted data to the server by attaching it to the end of
the URL in ‘the query string’
 POST
 used if the processing of a form causes side effects, likethe
modification of a database, updating a shopping cart, or sending
an email message
 Sends submitted data to the server by bundling up the data and
put it into HTTP header message body
How a form works
afm -INFO2301S1Y1314
 PHP holds values from a form in 3 ways
1) The simple short style. Example :$name, $id
// Available if the PHP directive register_globals = on. As of
// PHP 4.2.0 the default value of register_globals = off.
// Using/relying on this method is not preferred.
2) The medium style. Example :$_GET[‘name’], $_POST[‘id’]
// Available since PHP 4.1.0
3) The long style. Example : $HTTP_GET_VARS[‘name’],
$HTTP_POST_VARS[‘id’]
// As of PHP 5.0.0, these long predefined variables can be
// disabled with the register_long_arrays directive.
How PHP communicate with HTML form
afm -INFO2301S1Y1314
How PHP communicate with HTML form
afm -INFO2301S1Y1314
 Example PHP codes on receiving ends..
<html>
<body>
<?php
// Medium style;
$name = $_GET['your_name'];
$phone = $_GET['your_phone'];
$email = $_GET['your_email_addr'];
$this_file_dir = $_SERVER['PHP_SELF'] ;
echo ‘You’ve registered as‘.$name.’<br>’;
echo ‘Your phone number is’.$phone.’<br>’;
echo ‘Your email’.$email.’<br>’;
echo ‘this php file directory/path is ‘. $this_file_dir;
?>
</body>
</html>
How PHP communicate with HTML form
afm -INFO2301S1Y1314
Quiz 1??
afm -INFO2301S1Y1314
HTML
afm -INFO2301S1Y1314
FORMS
THE

More Related Content

PPT
Chapter 07 php forms handling
PPT
PHP - Introduction to PHP Forms
DOCX
Php forms and validations by naveen kumar veligeti
PDF
Making web forms using php
PPTX
Form Handling using PHP
PPTX
Php Form
PPT
Lecture7 form processing by okello erick
PPTX
HTML5 Web Forms
Chapter 07 php forms handling
PHP - Introduction to PHP Forms
Php forms and validations by naveen kumar veligeti
Making web forms using php
Form Handling using PHP
Php Form
Lecture7 form processing by okello erick
HTML5 Web Forms

What's hot (20)

PPTX
Html 5 Forms
PPTX
Javascript
PDF
Creating simple php contact form
PPTX
Forms in html5
PPTX
Introduction to Javascript
PPTX
Web engineering - HTML Form
PDF
Database connectivity in PHP
PPT
05 html-forms
PDF
The Django Book - Chapter 7 forms
PDF
HTML5 Forms - KISS time - Fronteers
PPTX
PHP Training in Ambala ! Batra Computer Centre
PPTX
JavaScript Training in Ambala ! Batra Computer Centre
PPTX
04. session 04 working withformsandframes
PDF
Tadhg Bowe - i18n: how can I rephrase that?
PPT
Html frames
DOC
PHP form tutorial
PDF
Getting started-with-oracle-so a-iv
PPT
Introduction to XML
PPTX
Java script basic
PDF
Introduction to HTML
Html 5 Forms
Javascript
Creating simple php contact form
Forms in html5
Introduction to Javascript
Web engineering - HTML Form
Database connectivity in PHP
05 html-forms
The Django Book - Chapter 7 forms
HTML5 Forms - KISS time - Fronteers
PHP Training in Ambala ! Batra Computer Centre
JavaScript Training in Ambala ! Batra Computer Centre
04. session 04 working withformsandframes
Tadhg Bowe - i18n: how can I rephrase that?
Html frames
PHP form tutorial
Getting started-with-oracle-so a-iv
Introduction to XML
Java script basic
Introduction to HTML
Ad

Viewers also liked (9)

PPT
Using arrays with PHP for forms and storing information
PPTX
PHP Forms PHP 05
PDF
Creating And Consuming Web Services In Php 5
PPTX
3 php forms
PPT
Php forms
PPSX
Php creating forms
PDF
Forms and Databases in PHP
PDF
PHP and Web Services
PDF
Creating Mobile Apps With PHP & Symfony2
Using arrays with PHP for forms and storing information
PHP Forms PHP 05
Creating And Consuming Web Services In Php 5
3 php forms
Php forms
Php creating forms
Forms and Databases in PHP
PHP and Web Services
Creating Mobile Apps With PHP & Symfony2
Ad

Similar to 03 the htm_lforms (20)

PPTX
Designing web pages html forms and input
PPTX
Html forms
PPT
Web forms and html lecture Number 4
PPTX
Html form tag
PPTX
Form using html and java script validation
PPTX
Unit - III.pptxbgffhjxfjdfjfgjnsnsnshdhsjsksjsjsjsjsjsjsjsjsldksk
PPTX
Unit - III.pptxbgffhjxfjdfjfgjnsnsnshdhsjsksjsjsjsjsjsjsjsjsldksk
PDF
CSS_Forms.pdf
PPTX
html 5 new form attribute
PPTX
Higher - HTML forms
PPTX
HNDIT1022 Week 03 Part 2 Theory information.pptx
DOCX
PPTX
Lecture 3 Introduction to HTML FORM AND CSS.pptx
PPTX
HTML Forms
DOC
Html basics 10 form
 
PDF
Html advanced-reference-guide for creating web forms
PPT
R12 MOAC AND PAYABLES
PPTX
Working with data.pptx
PPTX
Html forms
Designing web pages html forms and input
Html forms
Web forms and html lecture Number 4
Html form tag
Form using html and java script validation
Unit - III.pptxbgffhjxfjdfjfgjnsnsnshdhsjsksjsjsjsjsjsjsjsjsldksk
Unit - III.pptxbgffhjxfjdfjfgjnsnsnshdhsjsksjsjsjsjsjsjsjsjsldksk
CSS_Forms.pdf
html 5 new form attribute
Higher - HTML forms
HNDIT1022 Week 03 Part 2 Theory information.pptx
Lecture 3 Introduction to HTML FORM AND CSS.pptx
HTML Forms
Html basics 10 form
 
Html advanced-reference-guide for creating web forms
R12 MOAC AND PAYABLES
Working with data.pptx
Html forms

More from IIUM (20)

PDF
How to use_000webhost
PDF
Chapter 2
PDF
Chapter 1
PDF
Kreydle internship-multimedia
PDF
03phpbldgblock
PDF
Chap2 practice key
PDF
Group p1
PDF
Tutorial import n auto pilot blogspot friendly seo
PDF
Visual sceneperception encycloperception-sage-oliva2009
PDF
Exercise on algo analysis answer
PDF
Redo midterm
PDF
Heaps
PDF
Report format
PDF
Edpuzzle guidelines
PDF
Final Exam Paper
PDF
Final Exam Paper
PDF
Group assignment 1 s21516
PDF
Avl tree-rotations
PDF
Week12 graph
PDF
Vpn
How to use_000webhost
Chapter 2
Chapter 1
Kreydle internship-multimedia
03phpbldgblock
Chap2 practice key
Group p1
Tutorial import n auto pilot blogspot friendly seo
Visual sceneperception encycloperception-sage-oliva2009
Exercise on algo analysis answer
Redo midterm
Heaps
Report format
Edpuzzle guidelines
Final Exam Paper
Final Exam Paper
Group assignment 1 s21516
Avl tree-rotations
Week12 graph
Vpn

Recently uploaded (20)

PPTX
Institutional Correction lecture only . . .
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
Basic Mud Logging Guide for educational purpose
PPTX
Cell Types and Its function , kingdom of life
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Pre independence Education in Inndia.pdf
PPTX
Cell Structure & Organelles in detailed.
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
master seminar digital applications in india
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
Institutional Correction lecture only . . .
O5-L3 Freight Transport Ops (International) V1.pdf
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
O7-L3 Supply Chain Operations - ICLT Program
Module 4: Burden of Disease Tutorial Slides S2 2025
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
Basic Mud Logging Guide for educational purpose
Cell Types and Its function , kingdom of life
TR - Agricultural Crops Production NC III.pdf
Pre independence Education in Inndia.pdf
Cell Structure & Organelles in detailed.
Final Presentation General Medicine 03-08-2024.pptx
master seminar digital applications in india
Abdominal Access Techniques with Prof. Dr. R K Mishra
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Mark Klimek Lecture Notes_240423 revision books _173037.pdf

03 the htm_lforms

  • 2. Contents  Relations between PHP and HTML forms  Requirements for use of forms  How form works afm -INFO2301S1Y1314
  • 3. The two important tasks in dynamic websites I. Creating data II. Processing Data The relationships: afm -INFO2301S1Y1314
  • 4. Client-Server Interaction.  Interaction between user and web application.  Primary source of data (Client).  Process data to cater business needs (records keeping, financial report, application status, etc)  HTML and Web scripting depend on each other to form web application. The importance of HTML forms afm -INFO2301S1Y1314
  • 5.  Knowledge in HTML.  Strong foundation in Hypertext Markup Language is a prerequisite.  Knowing the HTML functions in the presentation layer.  Website design is central at HTML layer.  Design and functionality should be balance in any web application. The importance of HTML forms afm -INFO2301S1Y1314
  • 6. The typical use of HTML forms afm -INFO2301S1Y1314
  • 7.  A form on a web page gathers input data from the user.  The data the form controls varies e.g. buttons, text fields, menus, etc.  On the other hand the user's data is sent back to the server where it is processed by web programming languages, e.g. a PHP script The functions of forms afm -INFO2301S1Y1314 Example : <html> <form name:”fname” action =“input_dest.php” method=“post”> <! - - --- form inputs - - > </form> <html>
  • 8.  A form is an area that can contain form elements.  Form elements are elements that allow the user to enter information (like text fields, text area fields, dropdown menus,radio buttons, checkboxes, etc.) in a form.  A form is defined with the <form> tag. The functions of forms afm -INFO2301S1Y1314
  • 9.  An input form  The most used form tag is the <input> tag.  The type of input is specified with the type attribute.  We will look at some of the most commonly used input types.  Text Field input  Text fields are used when you want the user to type letters, numbers, etc. in a form. The functions of forms afm -INFO2301S1Y1314 Example : <form> First name: <input type="text" name="firstname"> <br> Last name: <input type="text" name="lastname"> </form>
  • 10.  Radio Buttons  Radio Buttons are used when you want the user to select one of a limited number of choices. The functions of forms afm -INFO2301S1Y1314 Example : <form> <input type="radio" name="sex“ value="male"> Male <br> <input type="radio" name="sex" value="female"> Female </form>
  • 11.  Checkboxes  Checkboxes are used when you want the user to select one or more options of a limited number of choices. The functions of forms afm -INFO2301S1Y1314 Example : <form> I have a bike: <input type="checkbox" name="vehicle" value="Bike“> <br> I have a car: <input type="checkbox" name="vehi cle" value="Car“> <br> I have an airplane: <input type="checkbox“ ame="vehicle" value="Airplane </form>
  • 12.  Submit Buttons  To be useful, a form will contain a submit button, which the user can press to send the data to the server (or whatever)  Use an input element with attribute type="submit“.  By default, the button has Submit Query written on it but you can supply our own label using the value attribute. The functions of forms afm -INFO2301S1Y1314 Example : <form> <input type=“submit“ ></br> <input type=“submit" value=“HANTAR" /> </form>
  • 13.  The Form's Action Attribute and the Submit Button  When the user clicks on the "Submit" button, the content of the form is sent to the server.  The form element has two attributes: action and method.  The form's action attribute defines the name of the file to send the content to.  The file defined in the action attribute usually does something with the received input. The functions of forms afm -INFO2301S1Y1314 Example : <form> name=“formName" action="html_form_submit.php“ method="get"> Username: <input type="text" name="user"> <input type="submit" value=“submit"> </form>
  • 14.  Reset button  A form might contain a reset button, which the user can press to clear the data s/he has typed  Use an input element with attribute type="reset“.  By default, the button has Reset written on it but you can supply your own label using the value attribute: The functions of forms afm -INFO2301S1Y1314 Example : <form> <input type="text" name="user"> <input type=“reset" value=“padam"> </form>
  • 15. 1. START with the HTML <form> tag 2. ACTION attribute of the <form> tag is the URL of the PHP script that ill process the input data from the form 3. METHOD on how to process the input data i. GET (Default) = appends the form-data to the URL in name/value pairs: RL?name=value&name=value ii. POST = Sends the form-data as an HTTP post transaction 4. CREATE the form with buttons, boxes, and others using HTML tags and fields 5. SUBMIT button so that the form can be processed 6. END the form with the </form> tag. End the HTML document with the </html> tag Steps to make web forms afm -INFO2301S1Y1314
  • 16. <html> <body> <form name="input" action="html_form_action.php" method="get"> Type your first name: <input type="text" name="FirstName" value="Mickey" size=“20”><br> Type your last name: <input type="text" name="LastName" value="Mouse" size=“20“><br> <input type="radio" name="sex" value="male"> Male <br> <input type="radio" name="sex" value="female"> Female I have a bike: <input type="checkbox" name="vehicle" value="Bike“><br> I have a car: <input type="checkbox" name="vehicle" value="Car"> <br> <input type="submit" value="Submit"> </form> <p> If you click the "Submit" button, you will send your input to a new page called html_form_action.php. </p> </body> </html> Steps to make web forms afm -INFO2301S1Y1314
  • 17.  When the user presses submit...  When the submit button is pressed, the browser arranges the data in name/value pairs How a form works afm -INFO2301S1Y1314 Example : <form> name=“formName" action="html_form_submit.php“ method="get"> Username: <input type="text" name="username"> <-- user type mickey-> <input type="text" name=“surname"> <-- user type mouse-> <input type="submit" value=“submit"> </form>
  • 18.  ..what happens in between the form & the server is .. The data arranged in name/value pairs, behind the scenes the browser also encodes the data using standard URL encoding: This replaces spaces, slashes and other chars that are not allowed in URLs by their hexadecimal equivalents  example 1: spaces are replaced by %20 (which may display as '+'); slashes by %2F Example 2: the user types Mickey and O Mouse into the form The data is arranged and encoded as follows firstname=Mickey&surname=O%20Mouse How a form works afm -INFO2301S1Y1314
  • 19.  ..in the end at the server is .. After the data is encoded, the browser creates an HTTP request  the command (method) is given by the method attribute the URL is given by the action attribute if method="get", the data is added to the end of the URL after a question mark,  e.g.: GET process.php?firstname=Mickey&surname=Mouse How a form works afm -INFO2301S1Y1314
  • 20.  an illustration.. How a form works afm -INFO2301S1Y1314
  • 21.  Notes on POST and GET methods  Notes on GET:  Appends form-data into the URL in name/value pairs  The length of a URL is limited (about 3000 characters)  Never use GET to send sensitive data! (will be visible in the URL)  Useful for form submissions where a user want to bookmark the result  GET is better for non-secure data, like query strings in Google  Notes on POST:  Appends form-data inside the body of the HTTP request (data is not shown is in URL)  Has no size limitations  Form submissions with POST cannot be bookmarked How a form works afm -INFO2301S1Y1314
  • 22.  Which method we need in form?  GET  The default method GET  sends submitted data to the server by attaching it to the end of the URL in ‘the query string’  POST  used if the processing of a form causes side effects, likethe modification of a database, updating a shopping cart, or sending an email message  Sends submitted data to the server by bundling up the data and put it into HTTP header message body How a form works afm -INFO2301S1Y1314
  • 23.  PHP holds values from a form in 3 ways 1) The simple short style. Example :$name, $id // Available if the PHP directive register_globals = on. As of // PHP 4.2.0 the default value of register_globals = off. // Using/relying on this method is not preferred. 2) The medium style. Example :$_GET[‘name’], $_POST[‘id’] // Available since PHP 4.1.0 3) The long style. Example : $HTTP_GET_VARS[‘name’], $HTTP_POST_VARS[‘id’] // As of PHP 5.0.0, these long predefined variables can be // disabled with the register_long_arrays directive. How PHP communicate with HTML form afm -INFO2301S1Y1314
  • 24. How PHP communicate with HTML form afm -INFO2301S1Y1314
  • 25.  Example PHP codes on receiving ends.. <html> <body> <?php // Medium style; $name = $_GET['your_name']; $phone = $_GET['your_phone']; $email = $_GET['your_email_addr']; $this_file_dir = $_SERVER['PHP_SELF'] ; echo ‘You’ve registered as‘.$name.’<br>’; echo ‘Your phone number is’.$phone.’<br>’; echo ‘Your email’.$email.’<br>’; echo ‘this php file directory/path is ‘. $this_file_dir; ?> </body> </html> How PHP communicate with HTML form afm -INFO2301S1Y1314