Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
3 views11 pages

Chapter 4

The document explains the differences between the GET and POST methods for submitting form data, highlighting that GET is suitable for non-sensitive data and allows bookmarking, while POST is preferred for sensitive data and supports larger amounts of information. It also introduces radio buttons and checkboxes as input elements, detailing their usage for selecting options in forms. Additionally, it mentions the processing of form data through a PHP file named 'welcome.php'.

Uploaded by

shidankita05
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views11 pages

Chapter 4

The document explains the differences between the GET and POST methods for submitting form data, highlighting that GET is suitable for non-sensitive data and allows bookmarking, while POST is preferred for sensitive data and supports larger amounts of information. It also introduces radio buttons and checkboxes as input elements, detailing their usage for selecting options in forms. Additionally, it mentions the processing of form data through a PHP file named 'welcome.php'.

Uploaded by

shidankita05
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

4.

Creating and Validating Forms


Text box:-A text input field allows a user to enter a
single line of text.
• When to use GET?
• 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!
• When to use POST? :-Developers prefer POST for
sending form data.
• 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.
When the user fills out the form above and clicks the submit button,
the form data is sent for processing to a PHP file named
"welcome.php".
Introduction to radio buttons :
To create a radio button, you use the <input> element with the
type radio.
Radio button let a user select only one of a limited number of
choices.

For example:
<input type="radio" name="contact" id="contact_email"
value="email" />Code language: HTML, XML (xml)
you can place the radio button within a <label> element like
this:
<label> <input type="radio" name="contact_email"
value="email"> Email
</label>
• Check box:- Let the user select one or more
options of a limited number of choices.
• The <input type="checkbox"> defines a
checkbox.
• The checkbox is shown as a square box that is
ticked (checked) when activated.
• Checkboxes are used to let a user select one
or more options of a limited number of
choices.

You might also like