Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'inc/header.php';
- if(strlen($_GET['view']) < 1) {
- include 'views/default.php';
- } else {
- if(file_exists('views/'. $_GET['view'] . '.php'))
- include 'views/'. $_GET['view'] .'.php';
- /*** mysql hostname ***/
- $hostname = 'localhost';
- /*** mysql username ***/
- $username = 'root';
- /*** mysql password ***/
- $password = 'password';
- try {
- $dbh = new PDO("mysql:host=$hostname;dbname=mysql", $username, $password);
- /*** echo a message saying we have connected ***/
- echo 'Connected to database';
- }
- catch(PDOException $e)
- {
- echo $e->getMessage();
- }
- else
- include 'views/default.php';
- }
- include 'inc/footer.php';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement