Advertisement
Guest User

Untitled

a guest
Apr 12th, 2017
67
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. if(stristr($_SERVER['REQUEST_URI'], 'config.php')){
  3. die("Wait a minute... who are yoooouuu? You're not allowed to come here.");
  4. }
  5.  
  6. /* Database Credentials */
  7. $DatabaseHost = "localhost"; //Database host (use localhost or 127.0.0.1)
  8. $DatabaseUser = "root"; //Database username login (standard root)
  9. $DatabasePassword = "E4URMJ99RTR94!@#"; //Database password
  10. $DatabaseName = "Smoothboard Stylers"; //The database name (use "test" for test proposal, because test is always in a standard MySQL Database)
  11.  
  12. /* Database Connection (PDO) */
  13. try {
  14. $DatabaseConnection = new PDO("mysql:host=$DatabaseHost;dbname=$DatabaseName", $DatabaseUser, $DatabasePassword);
  15. $DatabaseConnection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  16. //echo "Connectie succesvol gemaakt!"; //For test proposals, remove comment to see if connection is succesfull
  17. } catch(PDOexception $error) {
  18. echo "Connectie mislukt zie foutmelding: " . $error->getMessage();
  19. die();
  20. }
  21.  
  22. $pdo->execute($f);
  23. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement