Sessions Flashcards

1
Q

There are two ways the browser client can send information to the web server.

A

The GET method.
The POST method.

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

__ method is visible to everyone

A

GET

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

__ method is invisible to everyone

A

POST

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

__ is known as superglobal because it is built into PHP and is available throughout an entire script

A

$_POST

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

We use the method ___ in connecting to a database

A

mysqli_connect();

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

Before we can use a database, we need to identify the ___, __, __ of the MySQL database and ___

A
  1. servername
  2. username
  3. password
  4. database name
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

mysqli_connect() accepts 4 parameters:

A
  1. servername
  2. username
  3. password
  4. database name
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

t or f

Database name is optional, and can be omitted

A

t

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

We use __ to select the preferred database.

A

mysqli_select_db()

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

mysqli_select_db() accepts two parameters, first is the ___, second is the ___.

A
  1. database connection
  2. database name
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

When executing sql commands, we use ___

A

mysqli_query()

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

mysqli_query() accepts two parameters, first is the ___, second is the ____

A
  1. database connection
  2. query or the sql command
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

t or f
When an sql command will not return a value then we don’t need a variable that will catch the result of mysqli_query()

A

t

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

To close a database use ___

A

mysqli_close($connection);

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

A global variable stored on the server

A

Session

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

A special array used to store information across the page requests, a user makes during his/her visit to web application

17
Q

In a session based environment, every user is identified through a unique number called __

A

session identifier or SID

18
Q

It allows user to store information on the server for later use (e.g. username, shopping items, etc.)

A

Session Variables

19
Q

Sessions work by creating a ___ for each visitor and store variables based in this ___

A

unique id (UID)

20
Q

t or f

Session variables does not track data for a user while they travel through a series of web pages

A

f

Session variables tracks data for a user while they travel through a series of web pages

21
Q

The __ function is used to free the specified session variable.

22
Q

The _____ function will reset your session and will destroy all the stored session data.

A

session_destroy()

23
Q

t or f

Every time you want to use session
variables or unset the session variables, you need to start the session first before accessing the variables.