-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.php
36 lines (25 loc) · 914 Bytes
/
config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
// if(!isset($_SERVER['HTTP_REFERER'])){
// // redirect user to prevent un authorized access to this config file
// header('location: http://localhost/Freshcery/index.php');
// exit;
// }
try {
//host
if (!defined('HOST')) define("HOST", "localhost");
//dbname
if (!defined('DBNAME')) define("DBNAME", "freshcery");
//user
if (!defined('USER')) define("USER", "root");
//pass
if (!defined('PASS')) define("PASS", "");
$conn = new PDO("mysql:host=".HOST.";dbname=".DBNAME.";", USER, PASS);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// if($conn == true) {
// echo "connected successfully";
// } else {
// echo "errrrrrooooorrrrrr";
// }
} catch (PDOException $e) {
echo $e->getMessage();
}