-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwizGradeConnect.php
More file actions
88 lines (54 loc) · 3.09 KB
/
wizGradeConnect.php
File metadata and controls
88 lines (54 loc) · 3.09 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
wizGrade V 1.2 (Formerly SDOSMS) is Designed & Developed by Igweze Ebele Mark | https://www.iem.wizgrade.com
https://www.wizgrade.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Copyright 2014 - 2020 c wizGrade | IGWEZE EBELE MARK
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
wizGrade School App is Dedicated To Almighty God, My Amazing Parents ENGR Mr & Mrs Igweze Okwudili Godwin,
To My Fabulous and Supporting Wife Mrs Igweze Nkiruka Jennifer
and To My Inestimable Sons Osinachi Michael, Ifechukwu Othniel and Naetochukwu Ryan.
WEBSITE PHONES EMAILS
https://www.wizgrade.com +234 - 80 - 30 716 751, +234 - 80 - 22 000 490 info@wizgrade.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Page/Code Explanation~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This script handle application database connection
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
if (!defined('wizGrade')) /* This checks if this page was wrongly access by users */
die('Hahahaha, Hacking attempt . . . . Be Careful . . . . You Are Been Warned !!!!');
require 'dbConnectConfig.php'; /* database connection parameters */
if(($wizGradeDB == '') || ($server == '') || ($username == '') || ($password == '')){ /* check script installation */
$installScript =<<<IGWEZE
<meta http-equiv="refresh" content="0;URL='script-install'" />
IGWEZE;
echo $installScript;
exit;
}
/* PDO connection start */
try {
$conn = new PDO("mysql:host=$server; dbname=$wizGradeDB", $username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); /* PDO::ERRMODE_EXCEPTION, PDO::ERRMODE_SILENT, and PDO::ERRMODE_WARNING */
$conn->exec("SET CHARACTER SET utf8");
} catch(PDOException $e) {
die( 'Oooops Database Connection failed: ' . $e->getMessage());
}
/* PDO connection end */
/* mysqli connection start */
try {
$mysqli_conn = new mysqli($server, $username, $password, $wizGradeDB);
if ($mysqli_conn->connect_error) {
die( 'Oooops Database Connection failed: ' . $e->getMessage());
}
} catch(PDOException $e) {
die( 'Oooops Database Connection failed: ' . $e->getMessage());
}
/* mysqli connection end */
?>