Guest User

config.php

a guest
Jan 22nd, 2016
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  1. <?php
  2. # Errors - 1 is on, 0 is off.
  3.     error_reporting(0);
  4.  
  5. # Timezone
  6.     date_default_timezone_set("Europe/London");
  7.  
  8. # Connection
  9.     $server = "localhost";
  10.     $db_user = "changeme";
  11.     $db_pass = "changeme";
  12.     $database = "changeme";
  13.     $con = new mysqli($server,$db_user,$db_pass,$database);
  14.    
  15.     if($con->connect_error){
  16.         echo "
  17.             <div class=\"jumbotron\">
  18.                 <h1 style=\"text-align:center;\"> Oops! </h1>
  19.             </div>
  20.            
  21.                 <div class=\"container-fluid\">
  22.                     <div class=\"well\" style=\"color:red;\">Database connection refused. Open the file config.php and ensure the variables <code>db_user</code>,<code>db_pass</code> and <code>database</code> are using the correct information.</div>
  23.                 </div>
  24.             ";
  25.         exit;
  26.     }
  27.  
  28.  
  29. ?>
Add Comment
Please, Sign In to add comment