File: C:/laragon/www/newVip/PHPusersUpdateThirdUser.php
<?php
include_once 'PHPSpringServer.php';
$address = "";
if(isset($_POST["address"])){
$address = $_POST["address"];
}
$cap = "";
if(isset($_POST["cap"])){
$cap =$_POST["cap"];
}
$state = "";
if(isset($_POST["state"])){
$state = $_POST["state"];
}
$city = "";
if(isset($_POST["city"])){
$city = $_POST["city"];
}
$country = "";
if(isset($_POST["country"])){
$country = $_POST["country"];
}
$password = "";
if(isset($_POST["password"])){
$password = $_POST["password"];
}
$phoneNumber = "";
if(isset($_POST["phoneNumber"])){
$phoneNumber = $_POST["phoneNumber"];
}
$token = $_POST["token"];
$id = $_POST["id"];
$curl = curl_init();
$spring = new SpringServer();
curl_setopt_array($curl, array(
CURLOPT_URL => $spring->getUrl().'/users/updateThirdUser?id='.$id.'',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false ,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"address":"'.$address.'",
"cap":"'.$cap.'",
"city":"'.$city.'",
"state":"'.$state.'",
"country":"'.$country.'",
"phoneNumber":"'.$phoneNumber.'",
"password":"'.$password.'"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Auth: Bearer '.$token
),
));
$response = curl_exec($curl);
$httpcode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
http_response_code($httpcode);
curl_close($curl);
echo $response;
?>