Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- **********************
- BY QUANTUMA, FEEL FREE TO USE THIS AS YOU LIKE OF-COURSE ;)
- **********************
- <?php
- include("connection.php"); #If you're using this, be sure to make a connection.php and define your mysql connection details.
- /* ======== GLOBAL SETTINGS ======== */
- global $dbHost; global $dbUsername; global $dbPassword; global $dbName;
- global $dbOptions; global $dbTableBans; global $dbTableData; global $db;
- global $websiteContactEmail;
- /* ======== GLOBAL SETTINGS ======== */
- try {
- $db = new PDO("mysql:host={$dbHost};dbname={$dbName};charset=utf8", $dbUsername, $dbPassword, $dbOptions);
- } catch(PDOException $ex) {
- die("Database is currently offline, please contact the admistrator at " . $websiteContactEmail);
- }
- $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- $db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
- if(function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
- function undo_magic_quotes_gpc(&$array) {
- foreach($array as &$value) {
- if(is_array($value)) {
- undo_magic_quotes_gpc($value);
- } else {
- $value = stripcslashes($value);
- }
- }
- }
- undo_magic_quotes_gpc($_POST);
- undo_magic_quotes_gpc($_GET);
- undo_magic_quotes_gpc($_COOKIES);
- }
- header("Content-Type: text/html; charset=utf8");
- session_start();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement