Week 9 - PHP Part 3 Flashcards

1
Q

What are PHP Require and Include used for?

How are they different?

A

PHP Include is a function used for resuing PHP code such as menus.

Where include allows for the website to continue running, require means that it must be filled in otherwise there will be a fatal error and the website will crash.

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

How can we manage and maintain states between clients and servers?

A

Query strings, sessions and hidden fields.

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

State

A

The behaviour and interaction of a user during a web browser session.

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

Query Strings

A

A string of characters used to transfer data between PHP scripts to maintain state of a user.

They are found in the URL and have many parts to them which allow for specific information from a database to be received and allow this to work.

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

What do you need to pass information between websites using query strings?

A
  • ? after the URL
  • name = value pairs
  • & separating the name = value pairs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Sessions

A

An amount of time where PHP script will maintain the state on a web server.

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

Why do we want to maintain state information?

A

It ensures that the user’s experience and usability of the website will be as streamline as possible.

For example: not having to re-enter in their details on every subpage of a webpage.

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

Why is query string passing used?

A

So that we can pass information between PHP scripts.

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

Was HTTP stateful or stateless?

A

HTTP was a stateless protocol until cookies were introduced which made them stateful.

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

Hidden Input

A

A hidden field in a form which allows for data to be stored without the user seeing it.

Typically used for storing database records which need to be updated when form in submitted.

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