Sessions Flashcards
There are two ways the browser client can send information to the web server.
The GET method.
The POST method.
__ method is visible to everyone
GET
__ method is invisible to everyone
POST
__ is known as superglobal because it is built into PHP and is available throughout an entire script
$_POST
We use the method ___ in connecting to a database
mysqli_connect();
Before we can use a database, we need to identify the ___, __, __ of the MySQL database and ___
- servername
- username
- password
- database name
mysqli_connect() accepts 4 parameters:
- servername
- username
- password
- database name
t or f
Database name is optional, and can be omitted
t
We use __ to select the preferred database.
mysqli_select_db()
mysqli_select_db() accepts two parameters, first is the ___, second is the ___.
- database connection
- database name
When executing sql commands, we use ___
mysqli_query()
mysqli_query() accepts two parameters, first is the ___, second is the ____
- database connection
- query or the sql command
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()
t
To close a database use ___
mysqli_close($connection);
A global variable stored on the server
Session
A special array used to store information across the page requests, a user makes during his/her visit to web application
Session
In a session based environment, every user is identified through a unique number called __
session identifier or SID
It allows user to store information on the server for later use (e.g. username, shopping items, etc.)
Session Variables
Sessions work by creating a ___ for each visitor and store variables based in this ___
unique id (UID)
t or f
Session variables does not track data for a user while they travel through a series of web pages
f
Session variables tracks data for a user while they travel through a series of web pages
The __ function is used to free the specified session variable.
unset()
The _____ function will reset your session and will destroy all the stored session data.
session_destroy()
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.