mysql - php rest api failed to post data after hosting

one text

php rest api failed to post data after hosting with 000webhostapp but on localhost mysql rest api works fine please help me what is the cause Is there anything that must be set in the web host or is there a problem with the php code, I use this rest api for react native applications and with localhost it can run without any problems

<?php
include_once 'database.php';
require "./vendor/autoload.php";
use Firebase\JWT\JWT;

header("Access-Control-Allow-Origin: * ");
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Methods: POST");
header("Access-Control-Max-Age: 3600");
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");

$Name = '';
$email = '';
$password = '';
$conn = null;

$databaseService = new DatabaseService();
$conn = $databaseService->getConnection();

$data = json_decode(file_get_contents("php://input"));

$Name = $data->name;
$email = $data->email;
$password = $data->password;

$table_name = 'Users';

$query = "SELECT idusers, name FROM " . $table_name . " WHERE email = ? LIMIT 0,1";

$stmt = $conn->prepare( $query );
$stmt->bindParam(1, $email);
$stmt->execute();
$num = $stmt->rowCount();

if($num > 0){
    http_response_code(401);
    echo json_encode(array("message" => "email sudah ada"));
} else{
    $query = "INSERT INTO " . $table_name . "
                SET name = :name,
                    email = :email,
                    password = :password";

    $stmt = $conn->prepare($query);
    $stmt->bindParam(':name', $Name);
    $stmt->bindParam(':email', $email);
    $password_hash = password_hash($password, PASSWORD_BCRYPT);
    $stmt->bindParam(':password', $password_hash);

    if($stmt->execute()){
        $secret_key = "YOUR_SECRET_KEY";
        $issuer_claim = "THE_ISSUER"; // this can be the servername
        $audience_claim = "THE_AUDIENCE";
        $issuedat_claim = time(); // issued at
        $notbefore_claim = $issuedat_claim + 10; //not before in seconds
        $expire_claim = $issuedat_claim + 60; // expire time in seconds
        $token = array(
            "iss" => $issuer_claim,
            "aud" => $audience_claim,
            "iat" => $issuedat_claim,
            "nbf" => $notbefore_claim,
            "exp" => $expire_claim,
            "data" => array(
                "name" => $Name,
                "email" => $email
        ));

        http_response_code(200);

        $jwt = JWT::encode($token, $secret_key, 'HS512');
        echo json_encode(
            array(
                "access_token" => $jwt,
                "expireAt" => $expire_claim,
                "user" => array(
                    "name" => $Name,
                    "email" => $email,
                    "message" => "Successful register."
            )
            ));
    } else {
        http_response_code(400);

        echo json_encode(array("message" => "Unable to register the user."));
    }
}

?>

Source