Как сделать редирект? После того как в ответе от сервера появилось слово TRUE?
<form class="login" action="php/login.php" method="post">
<div class="login__field">
<i class="login__icon fas fa-user"></i>
<input name="login" class="login__input" type="text" placeholder="Логин">
</div>
<div class="login__field">
<i class="login__icon fas fa-lock"></i>
<input class="login__input" name="password" type="text" placeholder="Пароль">
</div>
<button class="button login__submit">
<span class="button__text">Войти</span>
<i class="button__icon fas fa-chevron-right"></i>
</button>
</form>
+ php
<?php
$login = $_POST['login'];
$password = $_POST['password'];
$url = "http://178.176.133.136:2315/Authorization";
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$headers = array(
"Content-Type: application/json",
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$array = array(
'login' => $login,
'userPassword' => $password,
);
$json = json_encode($array);
$data = $json;
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
//for debug only!
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$resp = curl_exec($curl);
curl_close($curl);
var_dump($resp);
$new_url = 'https://example.com/final.php';
$arr = json_decode($resp, true);
if ($arr["found"]) {
}