From 78b465217d43d00d26fc19c218628f2749b99cb7 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Mon, 27 Nov 2017 19:20:20 -0500 Subject: [PATCH 1/2] Update index.php --- website/index.php | 229 +--------------------------------------------- 1 file changed, 3 insertions(+), 226 deletions(-) diff --git a/website/index.php b/website/index.php index a1e17b7..6a71c1d 100644 --- a/website/index.php +++ b/website/index.php @@ -1,231 +1,8 @@ is_loggedin()) -{ - $user->redirect('home.php'); -} +require_once("inc/db.php"); +require_once("inc/Protomodel.php"); -?> - - - - - - - - - -
-
- -
SOME. TAGLINE. HERE.
- -
- - - -
-
-
- -
-
- - - -
-
-
- - - - - - - - +?> From 63c4aeeb977fbe36e2f6749ccff613ee3b9715bb Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Mon, 27 Nov 2017 19:21:09 -0500 Subject: [PATCH 2/2] Add files via upload --- website/inc/ProtoModel.php | 31 +++++++++++++++++++++++++++++++ website/inc/db.php | 24 ++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 website/inc/ProtoModel.php create mode 100644 website/inc/db.php diff --git a/website/inc/ProtoModel.php b/website/inc/ProtoModel.php new file mode 100644 index 0000000..70ad315 --- /dev/null +++ b/website/inc/ProtoModel.php @@ -0,0 +1,31 @@ +con->prepare($value); + $result = $stmt->execute(); + return $result; + } + + public function insert($value,$db=null){ + $stmt = $this->con->prepare($value); + $result = $stmt->execute(); + return $result; + } + + public function save($value,$db=null){ + $stmt = $this->con->prepare($value); + $result = $stmt->execute(); + return $result; + } +} + +$proto = new ProtoModel(); +$proto->update("UPDATE users SET username = 'byebye' WHERE id = '2'"); diff --git a/website/inc/db.php b/website/inc/db.php new file mode 100644 index 0000000..f168bc5 --- /dev/null +++ b/website/inc/db.php @@ -0,0 +1,24 @@ +con = $dbh = new PDO("mysql:host=$this->DbHost;dbname=$this->DbName", $this->DbUser, $this->DbPass); + $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + } + + public function insert($value,$db=null){ + $stmt = $this->con->prepare($value); + $result = $stmt->execute(); + return $result; + } +} + +$db = new Database();