Recevoir par mail les infos géographiques récupérees sur un client
Résolu/Fermé
ananias8686
Messages postés
86
Date d'inscription
samedi 9 février 2019
Statut
Membre
Dernière intervention
19 août 2023
-
Modifié le 17 avril 2020 à 02:04
ananias8686 Messages postés 86 Date d'inscription samedi 9 février 2019 Statut Membre Dernière intervention 19 août 2023 - 17 avril 2020 à 15:44
ananias8686 Messages postés 86 Date d'inscription samedi 9 février 2019 Statut Membre Dernière intervention 19 août 2023 - 17 avril 2020 à 15:44
A voir également:
- Recevoir par mail les infos géographiques récupérees sur un client
- Yahoo mail - Accueil - Mail
- Publipostage mail - Accueil - Word
- Formate pour taxer client frigo vide - Forum PDF
- Formate pour taxer client sur nourriture ✓ - Forum Consommation & Internet
- Windows live mail - Télécharger - Mail
2 réponses
jordane45
Messages postés
38451
Date d'inscription
mercredi 22 octobre 2003
Statut
Modérateur
Dernière intervention
9 mars 2025
4 739
17 avril 2020 à 08:34
17 avril 2020 à 08:34
Bonjour,
https://www.google.com/search?q=php+check+if+user+using+proxy
https://www.google.com/search?q=php+get+user+country
ce qui peut te conduire à trouver un code comme celui la:
https://www.google.com/search?q=php+check+if+user+using+proxy
https://www.google.com/search?q=php+get+user+country
ce qui peut te conduire à trouver un code comme celui la:
/** * Fonction trouvée ici : * https://stackoverflow.com/questions/12553160/getting-visitors-country-from-their-ip */ function ip_info($ip = NULL, $purpose = "location", $deep_detect = TRUE) { $output = NULL; if (filter_var($ip, FILTER_VALIDATE_IP) === FALSE) { $ip = $_SERVER["REMOTE_ADDR"]; if ($deep_detect) { if (filter_var(@$_SERVER['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP)) $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; if (filter_var(@$_SERVER['HTTP_CLIENT_IP'], FILTER_VALIDATE_IP)) $ip = $_SERVER['HTTP_CLIENT_IP']; } } $purpose = str_replace(array("name", "\n", "\t", " ", "-", "_"), NULL, strtolower(trim($purpose))); $support = array("country", "countrycode", "state", "region", "city", "location", "address"); $continents = array( "AF" => "Africa", "AN" => "Antarctica", "AS" => "Asia", "EU" => "Europe", "OC" => "Australia (Oceania)", "NA" => "North America", "SA" => "South America" ); if (filter_var($ip, FILTER_VALIDATE_IP) && in_array($purpose, $support)) { $ipdat = @json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=" . $ip)); if (@strlen(trim($ipdat->geoplugin_countryCode)) == 2) { switch ($purpose) { case "location": $output = array( "city" => @$ipdat->geoplugin_city, "state" => @$ipdat->geoplugin_regionName, "country" => @$ipdat->geoplugin_countryName, "country_code" => @$ipdat->geoplugin_countryCode, "continent" => @$continents[strtoupper($ipdat->geoplugin_continentCode)], "continent_code" => @$ipdat->geoplugin_continentCode ); break; case "address": $address = array($ipdat->geoplugin_countryName); if (@strlen($ipdat->geoplugin_regionName) >= 1) $address[] = $ipdat->geoplugin_regionName; if (@strlen($ipdat->geoplugin_city) >= 1) $address[] = $ipdat->geoplugin_city; $output = implode(", ", array_reverse($address)); break; case "city": $output = @$ipdat->geoplugin_city; break; case "state": $output = @$ipdat->geoplugin_regionName; break; case "region": $output = @$ipdat->geoplugin_regionName; break; case "country": $output = @$ipdat->geoplugin_countryName; break; case "countrycode": $output = @$ipdat->geoplugin_countryCode; break; } } } return $output; }
ananias8686
Messages postés
86
Date d'inscription
samedi 9 février 2019
Statut
Membre
Dernière intervention
19 août 2023
17 avril 2020 à 09:19
17 avril 2020 à 09:19
Bonjour,
Je vous remercie pour l'aide
Comment utiliser cette fonction pour recevoir le tout par mail car je souhaite recevoir le formulaire rempli (nom+e-mail + les infos IP). Mon code d'envoie de mail fonctionne bien mais comment recevoir aussi info IP dans le mail.
Merci
Je vous remercie pour l'aide
Comment utiliser cette fonction pour recevoir le tout par mail car je souhaite recevoir le formulaire rempli (nom+e-mail + les infos IP). Mon code d'envoie de mail fonctionne bien mais comment recevoir aussi info IP dans le mail.
Merci
jordane45
Messages postés
38451
Date d'inscription
mercredi 22 octobre 2003
Statut
Modérateur
Dernière intervention
9 mars 2025
4 739
17 avril 2020 à 09:32
17 avril 2020 à 09:32
tu appelles cette fonction dans ton code, tu stockes le résultat dans une variable
puis tu insères cette variable dans $message
puis tu insères cette variable dans $message
ananias8686
Messages postés
86
Date d'inscription
samedi 9 février 2019
Statut
Membre
Dernière intervention
19 août 2023
>
jordane45
Messages postés
38451
Date d'inscription
mercredi 22 octobre 2003
Statut
Modérateur
Dernière intervention
9 mars 2025
17 avril 2020 à 15:44
17 avril 2020 à 15:44
J'ai utiliser cette fonction en faisant une include de mon fichier php, ça marche parfaitement
ob_start(); include "ip.php"; $info_ip = ob_get_flush();