Subversion Repository Public Repository

Nextrek

Diff Revisions 249 vs 264 for /Android/SmartCharging/endPoints/registrazione_utente.php

Diff revisions: vs.
  @@ -1,4 +1,7 @@
1 1 <?php
2 + header("Access-Control-Allow-Origin: *");
3 + header('Content-Type: application/json; charset=UTF-8');
4 +
2 5 require_once("UserRepository.php");
3 6 require_once("User.php");
4 7
  @@ -6,13 +9,18 @@
6 9 $username = "smartcharging";
7 10 $password = "LXRLBaEAuRr7M7jY";
8 11
9 - $params = json_decode($_REQUEST["params"], true); //da portare su POST la richiesta
12 + //$params = json_decode($_REQUEST["params"], true);
13 +
14 + //$input = file_get_contents('php://input');
15 + $params = json_decode(file_get_contents('php://input'), true);
10 16
11 17 $conn;
12 18 //$risposta = array();
13 19 $user = new User();
14 20 $user_repo;
15 21
22 + //var_dump($params);
23 +
16 24 try {
17 25 $conn = new PDO("mysql:host=".$servername.";dbname=smartcharging", $username, $password);
18 26 $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);