Docsity

Web Designer a powerful weapon -- HTML, Summaries of Computer Science

Toggle sidebar
bg1
What is HTML?
HTML (HyperText Markup Language)is the most basic building block of the Web. It describes and defines
the content of a webpage along with the basic layout of the webpage
HTML stands for Hyper Text Markup Language HTML describes the structure of a Web page HTML
consists of a series of elements HTML elements tell the browser how to display the content HTML
elements are represented by tags HTML tags label pieces of content such as "heading", "paragraph",
"table", and so on Browsers do not display the HTML tags, but use them to render the content of the
page
HTML Forms
HTML Form is a document which stores information of a user on a web server using interactive controls.
An HTML form contains different kind of information such as username, password, contact number,
email id etc. The elements used in an HTML form are check box, input box, radio buttons, submit
buttons etc. Using these elements the information of an user is submitted on a web server.
Input Element in HTML Forms
Input Elements are the most common elements which are used in HTML Forms. Various user input
fields can be created such as textfield, check box, password field, radio button, submit button etc. The
most common input elements are listed below: 1. Text Field in HTML Forms : The text field is a one line
input field allowing the user to input text. Text Field input controls are created using the “input”
element with a type attribute having value as “text”.
2.Password
Field in HTML Forms : Password fields are a type of text field in which the text entered is masked using
asterisk or dots for prevention of user identity from another person who is looking onto the screen.
Password Field input controls are created using the “input” element with a type attribute having value
as “password
3.Radio Buttons in HTML Form :
Radio Buttons are used to let the user select exactly one option from a list of predefined options. Radio
Button input controls are created using the “input” element with a type attribute having value as
“radio”.
4.Checkboxes in HTML Form :
pf3
pf4
pf5

Partial preview of the text

Download Web Designer a powerful weapon -- HTML and more Summaries Computer Science in PDF only on Docsity!

What is HTML?

HTML (HyperText Markup Language)is the most basic building block of the Web. It describes and defines the content of a webpage along with the basic layout of the webpage HTML stands for Hyper Text Markup Language HTML describes the structure of a Web page HTML consists of a series of elements HTML elements tell the browser how to display the content HTML elements are represented by tags HTML tags label pieces of content such as "heading", "paragraph", "table", and so on Browsers do not display the HTML tags, but use them to render the content of the page

HTML Forms

HTML Form is a document which stores information of a user on a web server using interactive controls. An HTML form contains different kind of information such as username, password, contact number, email id etc. The elements used in an HTML form are check box, input box, radio buttons, submit buttons etc. Using these elements the information of an user is submitted on a web server.

Input Element in HTML Forms

Input Elements are the most common elements which are used in HTML Forms. Various user input fields can be created such as textfield, check box, password field, radio button, submit button etc. The most common input elements are listed below: 1. Text Field in HTML Forms : The text field is a one line input field allowing the user to input text. Text Field input controls are created using the “input” element with a type attribute having value as “text”.

2.Password

Field in HTML Forms : Password fields are a type of text field in which the text entered is masked using asterisk or dots for prevention of user identity from another person who is looking onto the screen. Password Field input controls are created using the “input” element with a type attribute having value as “password

3.Radio Buttons in HTML Form :

Radio Buttons are used to let the user select exactly one option from a list of predefined options. Radio Button input controls are created using the “input” element with a type attribute having value as “radio”.

4.Checkboxes in HTML Form :

Checkboxes are used to let the user select one or more options from a pre-defined set of options. Checkbox input controls are created using the “input” element with a type attribute having value as “checkbox”.

Select Box Control

A select box, also called drop down box which provides option to list down various options in the form of drop down list, from where a user can select one or more options.

File Upload Box

If you want to allow a user to upload a file to your web site, you will need to use a file upload box, also known as a file select box. This is also created using the element but type attribute is set to file.

Button Controls

There are various ways in HTML to create clickable buttons. You can also create a clickable button using tag by setting its type attribute to button.

Hidden Form Controls

Hidden form controls are used to hide data inside the page which later on can be pushed to the server. This control hides inside the code and does not appear on the actual page. For example, following hidden form is being used to keep current page number. When a user will click next page then the value of hidden control will be sent to the web server and there it will decide which page will be displayed next based on the passed current page.

The GET Method

GET is used to request data from a specified resource. GET is one of the most common HTTP methods. Note that the query string (name/value pairs) is sent in the URL of a GET request: /test/demo_form.php?name1=value1&name2=value Some other notes on GET requests: GET requests can be cached GET requests remain in the browser history GET requests can be bookmarked GET requests should never be used when dealing with sensitive data GET requests have length restrictions GET requests is only used to request data (not modify)

Advantages and Disadvantages of Using the GET

Method

PHP_SELF is a variable that returns the current script being executed. This variable returns the name and path of the current file (from the root folder). You can use this variable in the action field of the FORM. There are also certain exploits that you need to be aware of. We shall discuss all these points in this article. In a form on a PHP page, you can use:

or

or

in the action attribute of the form. Since echo $_SERVER['PHP_SELF'] does not pass variables for using GET and you have to use "", why would you use that or "#"? I'm asking because it took me some time to figure out that the variables are not passed with $_SERVER['PHP_SELF']. PHP $_GET PHP $_GET can also be used to collect form data after submitting an HTML form with method="get". $_GET can also collect data sent in the URL. PHP $_POST PHP $_POST is widely used to collect form data after submitting an HTML form with method="post". $_POST is also widely used to pass variables. PHP $_SERVER $_SERVER is a PHP super global variable which holds information about headers, paths, and script loPHP $_COOKIE An associative array of variables passed to the current script via HTTP Cookies.cations. $_REQUEST PHP $_REQUEST is used to collect data after submitting an HTML form. The example below shows a form with an input field and a submit button. When a user submits the data by clicking on "Submit", the form data is sent to the file specified in the action attribute of the tag. In this example, we point to this file itself for processing form data. If you wish to use another PHP file to process form data, replace that with the filename of your choice. Then, we can use the super global variable $_REQUEST to collect the value of the input field: