Advertisement
hollerith

Untitled

Sep 1st, 2017
416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. <?php
  2.  
  3. define('DB_HOST', 'localhost');
  4.  
  5. define('DB_NAME', 'truestre4_truestresser');
  6.  
  7. define('DB_USERNAME', 'truestre4_beard');
  8.  
  9. define('DB_PASSWORD','FeXmUvi4UfobdANHuJGk3ptszP7rsr4ocDBciy3jnef8a2');
  10.  
  11. define('ERROR_MESSAGE', 'Error Loading');
  12.  
  13. try {
  14.  
  15. $odb = new PDO('mysql:host=' . DB_HOST . ';dbname=' . DB_NAME, DB_USERNAME, DB_PASSWORD);
  16.  
  17.  
  18. } catch( PDOException $Exception ) {
  19.  
  20.  
  21. error_log('ERROR: '.$Exception->getMessage().' - '.$_SERVER['REQUEST_URI'].' at '.date('l jS \of F, Y, h:i:s A')."\n", 3, 'error.log');
  22.  
  23.  
  24. die(ERROR_MESSAGE);
  25.  
  26. }
  27.  
  28. function error($string){
  29.  
  30. return '<div class="alert alert-danger"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button><strong>ERROR:</strong> '.$string.'</div>';
  31.  
  32. }
  33.  
  34. function success($string) {
  35.  
  36. return '<div class="alert alert-success"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button><strong>SUCCESS:</strong> '.$string.'</div>';
  37.  
  38. }
  39.  
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement