« Modèle:Code PHP Stats » : différence entre les versions
Apparence
Page créée avec « <includeonly> <?php →* * Page pour obtenir et afficher les statistiques de simulation. * Code créé par [Votre Nom]. * Code libre d'utilisation. * Date : [Date d'aujourd'hui] : // Trouver les données $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://localhost:9000/jsonSimStats"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "postvar1=value1&postvar2=value2&postvar3=value3"); // Réponse curl_setopt($ch, CURLOPT_RETUR... » |
Aucun résumé des modifications |
||
| Ligne 29 : | Ligne 29 : | ||
if (json_last_error() === JSON_ERROR_NONE) { | if (json_last_error() === JSON_ERROR_NONE) { | ||
// Afficher la réponse | // Afficher la réponse | ||
echo " | echo "<pre>"; | ||
print_r($response); | print_r($response); | ||
echo " | echo "</pre>"; | ||
} else { | } else { | ||
echo "Erreur de décodage JSON : " . json_last_error_msg(); | echo "Erreur de décodage JSON : " . json_last_error_msg(); | ||
Version du 22 janvier 2026 à 14:09
Appeler le modèle ainsi :
{{Code PHP Stats}}