Part 6 - Working with forms and collecting data Flashcards

1
Q

what is a disadvantage of
Common gateway interface (CGI)

A

a disadvantage of this is that Every form returned to the server requires a new process to be created for the CGI script

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

describe the html tag
<.textarea></.textarea>

A

This tag can be used within a form to allow the user to enter multi line data such as an address or a comment or review. Any initial value can be supplied within the element itslef (ie between the tags)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is the markup to:
1. create a hidden field
2. give it a unique identification of “a_name”
3. give it a default value of “a_value”

A

describe the following markup
<.input type=”hidden” name=”a_name” value=”a_value” />

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

describe the action attribute of the html form element

A

this is used to define where the form will be sent such as to a script on a server

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

describe the
name attribute
of the html input tag

A

this provides an identification for the tag which can be used by css or javascript

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

this can be accomplished by:
<.fieldset>
<.legend>Personalia:</.legend>
<.input>


</.fieldset>

	**explained**
	<.fieldset> - this creates a boxing around our inputs
	<.legend> - this creates a legend for the boxed section
A

how can we divide our form up into sections

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

this provides an identification for the tag which can be used by css or javascript

A

describe the
name attribute
of the html input tag

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

this can be accomplished using:
Username: <.input type=”text” name=”user” />

A

how would we create a
username field
in a HTML form

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

describe the following markup
<.input type=”reset” name=”reset” value=”Reset” />

A

what is the markup that:
1. create a reset button
2. give it a unique identifier of reset
3. give the button text that says “reset”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

this is the name/value data in the url after the ? and is seen when the http get method is used to send form data

A

what is a
query string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

This defines the HTTP request method we would like to use such as GET or POST

A

describe the
method
attribute of the html form element

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what is the role of a
firewall

A

Its role is to determine which packets should and should not be accepted:
This can occur when a server makes a request to you or even when you request data from a server.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

this attribute when used with a radio button defines the group it belongs to (if this is selected other members of the group are deselected)

A

in the context of a html radio button describe the
name attribute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

this is HTTP but is secured (encrypted) using the ssl/tls protocol

A

describe HTTPS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

tells how to encode form data when the form method is ‘post’ (most commonly this is used to allow PHP, which you will encounter in Block 2, to accept file uploads).

A

describe the
enctype
attribute of the html form element

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

using this tag increases the accessibility of form fields by:
1.This will be read by screen readers
2.This itself acts as selectable so elements such as a radio button have a higher hit area

A

why should the <.label> tag be used with form fields to increase accessibility

give 2 reasons

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

this is used to define where the form will be sent such as to a script on a server

A

describe the action attribute of the html form element

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

this attribute can be used to have radio button selected by default

A

in the context of a html radio button describe the
** checked attribute**

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

describe how the html
type=”reset”
of the input tag works

A

Often ommited but can be used to reset all the form data back to there default values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

describe the following markup
<.input type=”hidden” name=”a_name” value=”a_value” />

A

what is the markup to:
1. create a hidden field
2. give it a unique identification of “a_name”
3. give it a default value of “a_value”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

this attribute specifies the maximum number of characters allowed in an input field.

A

describe the
maxlength attribute
of the html input tag

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

this is done using

<.form></.form>

A

how do we create a html form element

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

how can we divide our form up into sections

A

this can be accomplished by:
<.fieldset>
<.legend>Personalia:</.legend>
<.input>


</.fieldset>

	**explained**
	<.fieldset> - this creates a boxing around our inputs
	<.legend> - this creates a legend for the boxed section
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

this can be accomplished using:
<.input type=”file” name=”upload1”/>

A

how do we create a
file upload button
in html

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

when this is being used the form element must have
enctype=”multipart/form-data”

this is required in the form element when submitting files. This tells the server to expect one or more attached files

A

what is required in the form element when using the input type “file”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

this provides an initial value for the input tag

A

describe the
value attribute
of the html input tag

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

what 2 methods can be used to bound a <.label> tag to a <.input> tag

A

this can be accomplished by:
1.<.label for=”ID of input”><./label>
2.Nesting the input inside the label

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

what is the markup to
create a radio button

A

the markup is:
<.input type=”radio”>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

describe the global attribute
tabindex

A

this can be used to control the flow of focus when the keyboard is being used

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

When the form is submitted using this method the name/value pairs are appended to the url after a question mark (?)
NOTE: this method is insecure

A

describe how a form is submitted when the method is GET

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

in the context of a html radio button describe the
name attribute

A

this attribute when used with a radio button defines the group it belongs to (if this is selected other members of the group are deselected)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

this can be used to control the flow of focus when the keyboard is being used

A

describe the global attribute
tabindex

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

Its role is to determine which packets should and should not be accepted:
This can occur when a server makes a request to you or even when you request data from a server.

A

what is the role of a
firewall

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

how do we create a html form element

A

this is done using

<.form></.form>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

describe how the html
type=”submit”
of the input tag works

A

this will create a button that when pressed will send the form data to The form-handler which is specified in the form’s action attribute.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

this can be accomplished using:
Password: <.input type=”password” name=”password” />

A

how would we
create a password field
in a html form

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

describe the
accept-charset
attribute of the html form element

A

a comma-separated list of character sets the form data may be in (in practice the server will accept the character set defined in the header of the document)

38
Q

this can be accomplished by:
1.<.label for=”ID of input”><./label>
2.Nesting the input inside the label

A

what 2 methods can be used to bound a <.label> tag to a <.input> tag

39
Q

Can be used within a form to collect data from the user
NOTE: this is an empty element for it to be XML compliant we need to self close it

A

describe the tag
<.input>

40
Q

a simple usage scennerio would be:
1.User submits form data
2.Form data sent to server via HTTP along with url denoting CGI script
3.Web server launches the CGI script and passes it the form data
4.The output of the CGI script (usually html) can then be sent back to the client

A

in 4 steps give a typical usage scenerio of
Common gateway interface (CGI)

41
Q

this is a specification that allows web servers to execute an external program such as a script. This specification has standards on how data is received and sent

A

describe breifly the
Common gateway interface (CGI)

42
Q

its primary role is to prove that a server can be trusted. when a client receives this it can check that it was signed by a trusted CA

this also holds the servers public key

A

what is the role of an
ssl certificate

43
Q

in 4 steps give a typical usage scenerio of
Common gateway interface (CGI)

A

a simple usage scennerio would be:
1.User submits form data
2.Form data sent to server via HTTP along with url denoting CGI script
3.Web server launches the CGI script and passes it the form data
4.The output of the CGI script (usually html) can then be sent back to the client

44
Q

describe the
value attribute
of the html input tag

A

this provides an initial value for the input tag

45
Q

describe the tag
<.input>

A

Can be used within a form to collect data from the user
NOTE: this is an empty element for it to be XML compliant we need to self close it

46
Q

this can be accomplished by the following:
<.select name=”cars” id=”cars”>
<option>Volvo</option>
<.option value=”saab”>Saab</.option>
<.option value=”opel”>Opel</.option>
<.option value=”audi”>Audi</.option>
</.select>

A

how can we
create a drop down box
in html

47
Q

in the context of a html radio button describe the
** checked attribute**

A

this attribute can be used to have radio button selected by default

48
Q

this will create a button that when pressed will send the form data to The form-handler which is specified in the form’s action attribute.

A

describe how the html
type=”submit”
of the input tag works

49
Q

defines the type of input such as text or email

A

describe the
type
attribute of the html input element

50
Q

describe the following markup

<.input type=”radio” name=”contact” value=”phone” checked=”true” />

A

what is the markup to create a radio button that:
1. belongs to the group contact
2. has a form value of phone
3. and is checked by default

51
Q

describe breifly the
Common gateway interface (CGI)

A

this is a specification that allows web servers to execute an external program such as a script. This specification has standards on how data is received and sent

52
Q

how do we
create checkboxes
in html

A

this can be accomplished using
<.input type=”checkbox” name=”literature” />

53
Q

this is the value of the radio button that will be sent to the server

A

in the context of a html radio button describe the
value attribute

54
Q

how would we create a
username field
in a HTML form

A

this can be accomplished using:
Username: <.input type=”text” name=”user” />

55
Q

what is the markup that:
1. create a reset button
2. give it a unique identifier of reset
3. give the button text that says “reset”

A

describe the following markup
<.input type=”reset” name=”reset” value=”Reset” />

56
Q

these include:
1.Source address
2.Destination address
3.Protocols being used
4.Port numbers

A

name 4 criteria a firewall may take into account when deciding an action for a packet

57
Q

this will obscure the password on the screen only
it does not obscure
1. the password if placed in html source code
2. the password if it is sent in the browser URL using a GET request
3. the password using a POST request without HTTPS

A

what does the type=”password” of input 1. obscure
2. not obscure

58
Q

this can be accomplished using
<.input type=”checkbox” name=”literature” />

A

how do we
create checkboxes
in html

59
Q

give 3 reasons why we might want to use hidden fields in a html form

A

reasons for using this include:
1.Hold extra information about the user
2.Hold information about where they are posting on the site
3.Use to carry information over multi page forms

60
Q

in the context of a html radio button describe the
value attribute

A

this is the value of the radio button that will be sent to the server

61
Q

describe the
maxlength attribute
of the html input tag

A

this attribute specifies the maximum number of characters allowed in an input field.

62
Q

This tag can be used within a form to allow the user to enter multi line data such as an address or a comment or review. Any initial value can be supplied within the element itslef (ie between the tags)

A

describe the html tag
<.textarea></.textarea>

63
Q

what is the markup to create a radio button that:
1. belongs to the group contact
2. has a form value of phone
3. and is checked by default

A

describe the following markup

<.input type=”radio” name=”contact” value=”phone” checked=”true” />

64
Q

how do we create a
file upload button
in html

A

this can be accomplished using:
<.input type=”file” name=”upload1”/>

65
Q

this attribute specifies the visible width, in characters, of an input field.

A

describe the
size attribute
of the html input tag

66
Q

describe the functionality of a hidden field in a html form

A

This can be used to create a hidden field within the form that is not seen by the user. Although it will be submitted with the form.

67
Q

a comma-separated list of character sets the form data may be in (in practice the server will accept the character set defined in the header of the document)

A

describe the
accept-charset
attribute of the html form element

68
Q

reasons for using this include:
1.Hold extra information about the user
2.Hold information about where they are posting on the site
3.Use to carry information over multi page forms

A

give 3 reasons why we might want to use hidden fields in a html form

69
Q

describe the following markup
<.input type=”submit” name=”submit” value=”Submit” />

A

this markup will create a submit button that:
1. has a name that identifies it as “submit”
2. has text on the button itself saying submit

70
Q

this markup will create a submit button that:
1. has a name that identifies it as “submit”
2. has text on the button itself saying submit

A

describe the following markup
<.input type=”submit” name=”submit” value=”Submit” />

71
Q

how can we
create a drop down box
in html

A

this can be accomplished by the following:
<.select name=”cars” id=”cars”>
<option>Volvo</option>
<.option value=”saab”>Saab</.option>
<.option value=”opel”>Opel</.option>
<.option value=”audi”>Audi</.option>
</.select>

72
Q

name 4 criteria a firewall may take into account when deciding an action for a packet

A

these include:
1.Source address
2.Destination address
3.Protocols being used
4.Port numbers

73
Q

the markup is:
<.input type=”radio”>

A

what is the markup to
create a radio button

74
Q

what is a
query string

A

this is the name/value data in the url after the ? and is seen when the http get method is used to send form data

75
Q

why should the <.label> tag be used with form fields to increase accessibility

give 2 reasons

A

using this tag increases the accessibility of form fields by:
1.This will be read by screen readers
2.This itself acts as selectable so elements such as a radio button have a higher hit area

76
Q

a disadvantage of this is that Every form returned to the server requires a new process to be created for the CGI script

A

what is a disadvantage of
Common gateway interface (CGI)

77
Q

Often ommited but can be used to reset all the form data back to there default values

A

describe how the html
type=”reset”
of the input tag works

78
Q

describe the
method
attribute of the html form element

A

This defines the HTTP request method we would like to use such as GET or POST

79
Q

describe the
enctype
attribute of the html form element

A

tells how to encode form data when the form method is ‘post’ (most commonly this is used to allow PHP, which you will encounter in Block 2, to accept file uploads).

80
Q

how would we
create a password field
in a html form

A

this can be accomplished using:
Password: <.input type=”password” name=”password” />

81
Q

describe how a form is submitted when the method is POST

A

When using this method the data is passed to the server within the HTTP request and if HTTPS is in use the data will be encrypted
NOTE: only secure if HTTPS is in use

82
Q

describe the
type
attribute of the html input element

A

defines the type of input such as text or email

83
Q

describe how a form is submitted when the method is GET

A

When the form is submitted using this method the name/value pairs are appended to the url after a question mark (?)
NOTE: this method is insecure

84
Q

what is required in the form element when using the input type “file”

A

when this is being used the form element must have
enctype=”multipart/form-data”

this is required in the form element when submitting files. This tells the server to expect one or more attached files

85
Q

describe the
size attribute
of the html input tag

A

this attribute specifies the visible width, in characters, of an input field.

86
Q

When using this method the data is passed to the server within the HTTP request and if HTTPS is in use the data will be encrypted
NOTE: only secure if HTTPS is in use

A

describe how a form is submitted when the method is POST

87
Q

what is the role of an
ssl certificate

A

its primary role is to prove that a server can be trusted. when a client receives this it can check that it was signed by a trusted CA

this also holds the servers public key

88
Q

describe HTTPS

A

this is HTTP but is secured (encrypted) using the ssl/tls protocol

89
Q

This can be used to create a hidden field within the form that is not seen by the user. Although it will be submitted with the form.

A

describe the functionality of a hidden field in a html form

90
Q

what does the type=”password” of input 1. obscure
2. not obscure

A

this will obscure the password on the screen only
it does not obscure
1. the password if placed in html source code
2. the password if it is sent in the browser URL using a GET request
3. the password using a POST request without HTTPS