<?php

if($_SERVER["REQUEST_METHOD"]=="POST"){

    createUser();
}
function createUser()
{

    //global $connect;

    $servername = "localhost";
    $username = "dotrazie_android";
    $password = "12345!@#$%";
    $dbname = "dotrazie_android";

// Create connection
    $conn = new mysqli($servername, $username, $password,$dbname);

    $telefon = $_POST["telefon"];
    $user = $_POST["user"];


    //$age = $_POST["age"];

    //$query = "Insert into tblComenzi(IDCafea,IDClient,Variatie,LapteSoya,ExtraShot,NivelLapte,NivelSpuma,Latitude,Longitude,Estimation,Total) values (1,2,'test','true','true',50,10,12.123123,12.121212,'10 min',10)";

    $query = "Insert into tblUtilizatori(Nume,Telefon) values ('$user','$telefon');";

    //mysqli_query($conn, $query) or die (mysqli_error($conn));

    if (mysqli_query($conn, $query) or die (mysqli_error($conn) . "\nquery:" . $query)) echo "Good!" . "\nquery:" . $query;
    mysqli_close($conn);

}

?>

