Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *@author Joseph Lazarus
- *@copyright Team PaNiiC
- **/
- // Load Local Debug + mySQL Variables
- $dbHost = "127.0.0.1";
- $dbUser = "root";
- $dbPass = "";
- $dbName = "testdb";
- $mySQL_Mode = 1;
- $websiteEnabled = 1;
- $websiteVersion = "1.0";
- // Will kill the page before the rest of the code is executed, if maintenance is enabled.
- if($websiteEnabled != 1)
- {
- die('<b>Maintenance Mode</b>: The administrator has the website temporairly disabled.');
- }
- // The cleansing function to prevent SQL Injection
- // Example: $gender = clean($_POST['gender']);
- function clean($str)
- {
- $str = @trim($str);
- if(get_magic_quotes_gpc())
- { $str = stripslashes($str); }
- return mysql_real_escape_string($str);
- }
- if($mySQL_Mode == 1)
- {
- $connect = mysql_connect($dbHost,$dbUser,$dbPass);
- if($connect) {
- $select_db = mysql_select_db($dbName, $connect);
- }
- if (!$connect) {
- die('<b>Critical Error</b>: The mySQL server could not be found.');
- }
- if (!$select_db) {
- die('<b>Critical Error</b>: There was en error selecting the database.');
- }
- } else { die('mySQL Mode is disabled.'); }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement