-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
trying to remove SQL injection attack vulunerablities
- Loading branch information
dr-matt-smith
committed
Mar 24, 2019
1 parent
dfef72d
commit e09a4f4
Showing
6 changed files
with
135 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
|
||
define('DB_HOST', 'localhost:3306'); | ||
define('DB_USER', 'root'); | ||
define('DB_PASS', 'passpass'); | ||
define('DB_NAME', 'evote'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
require_once __DIR__ . '/../config/db.php'; | ||
require_once __DIR__ . '/../vendor/autoload.php'; | ||
|
||
use Tudublin\MovieRepository; | ||
|
||
// for Car DB actions | ||
$movieRepository = new MovieRepository(); | ||
|
||
//$movieRepository->delete(2); | ||
//$movies = $movieRepository->searchByColumn('title', 'jaws'); | ||
// | ||
// | ||
//$movie = $movieRepository->getOneById(3); | ||
//$movie->setTitle('lskdjflksdjflds'); | ||
//$movieRepository->update($movie); | ||
|
||
$m = new \Tudublin\Movie(); | ||
$m->setTitle('pop'); | ||
$m->setPrice(8.01); | ||
$movieRepository->create($m); | ||
|
||
$movies = $movieRepository->getAll(); | ||
|
||
var_dump($movies); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
namespace Tudublin; | ||
|
||
|
||
class Movie | ||
{ | ||
private $id; | ||
private $title; | ||
private $price; | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getId() | ||
{ | ||
return $this->id; | ||
} | ||
|
||
/** | ||
* @param mixed $id | ||
*/ | ||
public function setId($id) | ||
{ | ||
$this->id = $id; | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getTitle() | ||
{ | ||
return $this->title; | ||
} | ||
|
||
/** | ||
* @param mixed $title | ||
*/ | ||
public function setTitle($title) | ||
{ | ||
$this->title = $title; | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getPrice() | ||
{ | ||
return $this->price; | ||
} | ||
|
||
/** | ||
* @param mixed $price | ||
*/ | ||
public function setPrice($price) | ||
{ | ||
$this->price = $price; | ||
} | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
namespace Tudublin; | ||
|
||
use Mattsmithdev\PdoCrudRepo\DatabaseTableRepository; | ||
|
||
class MovieRepository extends DatabaseTableRepository | ||
{ | ||
|
||
} |