Move Upload Path To Constant In An Include File Flashcards
How do you connect to an SQL database?
mysqli_connect(‘address’,’username’,’password’,’database’);
How do you query the sql database?
Mysqli_query(“SELECT * FROM database_name”;
How do you call script that is shared?
require_once(‘shared_vars.php’);
How do you define a constant?
define (‘CONSTANT_NAME’, ‘storedinfo’);
Call it by example:
$target = CONSTANT_NAME . $othervar;
How do you delete a file from a ab server?
Using unlink() function
How do you suppress any potential errors from a function?
Precede it with an @ symbol. Eg:
@unlink()
What is better for data retrieval that doesn’t change anything on the server, GET or POST?
POST is used to send data to the server through a form.
GET is used for data retrieval that doesn’t change anything on the server
How do you clear data from variables?
By setting the variable to nothing.
Ex:
$vartobecleared = “”;
The type attribute of the tag must be set to this for a file upload form field.
File
It is usually a good idea to store uploaded app images in a …… Folder.
Images
This SQL statement is used to change the structure of a table.
ALTER
To prevent DELETE FROM statement from deleting more than one row, use this SQL statement.
LIMIT
When a file is uploaded through a form it is place in a ……… Folder on the web server.
Temporary
This PHP statement is used to create a constant.
Define()
Information about uploaded files are stored in the $_….. Superglobal variable.
$_FILES()