1/19
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
HTML FORMS
Play an important role in PHP web applications.
HTML Form
Is a collection various form controls such as text fields, checkboxes, radio buttons, etc., with which the user can interact, enter or choose certain data that may be either locally processed by JavaScript (client-side processing), or sent to a remote server for processing with the help of server-side programming scripts such as PHP.
1. Action Attribute
2. Enctype Attribute
3. Method Attribute
4. Name Attribute
Types of Attribute
Action Attribute
A string representing the URL that processes the form submission. For example, http://example.com/test.php.
PHP_SELF
To submit the for-data to the same PHP script in which the HTML form is defined, use the
Enctype Attribute
Specifies the method using which the form-data should be encoded before sending it to the server.
Method Attribute
A string representing the HTTP method to submit the form with.
Name Attribute
The name of the form. The value must not be the empty string, and must be unique if there are multiple forms in the same HTML document.
Form Elements
A HTML form is designed with different types of controls or elements. The user can interact with these controls to enter data or choose from the available options presented.
Input Element
Represents a data field, which enables the user to enter and/or edit the data
1. Text
2. Password
3. Checkbox
4. Radio
5. File
6. Selection
7. Submit
What are the Input Element Types?
Text
A text field to enter a single line text.
Password
A single line text filed that masks the entered characters.
Checkbox
A rectangular checkable box which is a set of zero or more values from a predefined list.
Radio
This type renders a round clickable button with two states (ON or OFF), usually a part of multiple buttons in a radio group
File
The input type renders a button captioned file and allows the user to select a file from the client filesystem, usually to be uploaded on the server.
Selection
Represents a control for selecting amongst a set of options. Each choice is defined with option attribute of Select Control.
Submit
This input element renders a button, which when clicked, initiates the the submission of form data to the URL specified in the action attribute of the current form.
header()
header("Location: http://www.example.com/another-page.php");
Where http://www.example.com/another-page.php is the location of the php file which will handle the next page.
window.location.replace
Code for redirectinng forms in JavaScript