multiplayer en php
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
ce6871a30f
commit
71e34a8bcc
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$api_url = "https://trusting-panini.87-106-126-109.plesk.page/api/utiliser/7/qUOGkWdoPCgbmuqxIC8xiaX0rV1Pw1LoPafkaoHOgszEyD9P2vcOu493xCDZpAqO";
|
||||||
|
|
||||||
|
$curl = curl_init($api_url);
|
||||||
|
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
|
||||||
|
// Désactivez la vérification du certificat SSL (à utiliser uniquement dans un environnement de développement)
|
||||||
|
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||||
|
|
||||||
|
$response = curl_exec($curl);
|
||||||
|
curl_close($curl);
|
||||||
|
|
||||||
|
if ($response === false) {
|
||||||
|
die('Erreur cURL : ' . curl_error($curl));
|
||||||
|
}
|
||||||
|
|
||||||
|
echo $response;
|
||||||
|
?>
|
@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// Récupérez les données passées en tant que paramètres de requête
|
||||||
|
$idplayerpost = isset($_GET["idplayer"]) ? $_GET["idplayer"] : '';
|
||||||
|
$playertime = isset($_GET["playertime"]) ? $_GET["playertime"] : '';
|
||||||
|
|
||||||
|
// Construisez l'URL de l'API pour l'update
|
||||||
|
$api_url = "https://trusting-panini.87-106-126-109.plesk.page/api/update/utiliser/7/{$idplayerpost}/qUOGkWdoPCgbmuqxIC8xiaX0rV1Pw1LoPafkaoHOgszEyD9P2vcOu493xCDZpAqO";
|
||||||
|
|
||||||
|
// Initialisez cURL pour la requête POST
|
||||||
|
$curl = curl_init($api_url);
|
||||||
|
|
||||||
|
// Configuration de cURL pour une requête POST
|
||||||
|
curl_setopt($curl, CURLOPT_POST, true);
|
||||||
|
curl_setopt($curl, CURLOPT_POSTFIELDS, [
|
||||||
|
'idplayer' => $idplayerpost,
|
||||||
|
'playertime' => $playertime
|
||||||
|
]);
|
||||||
|
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
|
||||||
|
// Désactivez la vérification du certificat SSL (à utiliser uniquement dans un environnement de développement)
|
||||||
|
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||||
|
|
||||||
|
// Exécution de la requête POST et récupération de la réponse
|
||||||
|
$response = curl_exec($curl);
|
||||||
|
|
||||||
|
// Fermeture de la session cURL
|
||||||
|
curl_close($curl);
|
||||||
|
|
||||||
|
// Vérification des erreurs de cURL
|
||||||
|
if ($response === false) {
|
||||||
|
die('Erreur cURL : ' . curl_error($curl));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
Loading…
Reference in new issue