Nextrek
Diff Revisions
507
vs
579
for /Android/SmartCharging/endPoints/examples/check_token.php
|
@@ -2,18 +2,20 @@ |
2 |
2 |
|
header("Access-Control-Allow-Origin: *"); |
3 |
3 |
|
header('Content-Type: application/json; charset=UTF-8'); |
4 |
4 |
|
|
|
5 |
+ |
require_once(dirname(__FILE__)."../../constants.php"); |
|
6 |
+ |
|
5 |
7 |
|
require_once(dirname(__FILE__)."/../repositories/UserRepository.php"); |
6 |
8 |
|
|
7 |
|
- |
$servername = "localhost"; |
|
9 |
+ |
/*$servername = "localhost"; |
8 |
10 |
|
$username = "smartcharging"; |
9 |
|
- |
$password = "LXRLBaEAuRr7M7jY"; |
|
11 |
+ |
$password = "LXRLBaEAuRr7M7jY";*/ |
10 |
12 |
|
|
11 |
13 |
|
$params = json_decode(file_get_contents('php://input'), true); |
12 |
14 |
|
$risposta = array(); |
13 |
15 |
|
|
14 |
16 |
|
$conn; |
15 |
17 |
|
try { |
16 |
|
- |
$conn = new PDO("mysql:host=".$servername.";dbname=smartcharging", $username, $password); |
|
18 |
+ |
$conn = new PDO("mysql:host=".DB_SERVERNAME.";dbname=".DB_NAME, DB_USERNAME, DB_PASSWORD); |
17 |
19 |
|
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
18 |
20 |
|
//echo "Connesso con successo al DB"; |
19 |
21 |
|
|