-
Notifications
You must be signed in to change notification settings - Fork 7
Useful Functions, Constants, Variables
RedDragonWebDesign edited this page Oct 31, 2020
·
17 revisions
-
Basic->get_info_filtered()
- Sanitizes HTML. Similar tohtmlspecialchars()
-
$mysqli->query()
- The preferred way of querying the database if you are not using a class.
Constants are always global. define()
to set, if ( defined() )
to check.
-
MAIN_ROOT
- by way ofdefine("MAIN_ROOT", $MAIN_ROOT);
in _setup.php -
BASE_DIRECTORY
- by way ofdefine("BASE_DIRECTORY", $BASE_DIRECTORY);
in _setup.php LOGGED_IN
Need to use global
keyword to access these inside a function or class.
-
$MAIN_ROOT
- Relative web path that is required for URL's in HTML and JS, and for setting cookie paths. Should start and end with a slash.- Example:
echo '<a href="'.$MAIN_ROOT.'members/index.php">My Account</a>';
$MAIN_ROOT = "/BlueThrust5%20R17/src/";
$_SERVER['REQUEST_URI']
- Example:
-
$BASE_DIRECTORY
- Absolute server path that is required when using PHP functions. Should end with a slash. On Linux, should start with a slash. On Windows, uses forward slashes.- Example:
require_once($BASE_DIRECTORY.'members/index.php');
$BASE_DIRECTORY = "D:/Dropbox/Code/BlueThrust5 R17/src/";
$_SERVER['SCRIPT_FILENAME']
- Example:
-
$dbprefix
or$this->MySQL->get_tablePrefix()
- SQL table prefix, if used. -
$prevFolder
- Example:../../
$siteDomain
-
$dispHTTP
- Equalshttp
orhttps