| Current Path : /home/happyrenas/myreco.online/ |
Linux webd005.cluster105.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 |
| Current File : /home/happyrenas/myreco.online/ip.php |
<?php
// Méthode simple (file_get_contents doit être autorisé pour URL)
$serverPublicIp = @file_get_contents('https://api.ipify.org'); // retourne juste l'IP
if ($serverPublicIp === false) {
// Fallback cURL si nécessaire
$ch = curl_init('https://api.ipify.org');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 5,
]);
$serverPublicIp = curl_exec($ch) ?: 'Impossible de récupérer';
curl_close($ch);
}
echo 'IP publique sortante du serveur : ' . htmlspecialchars(trim($serverPublicIp));