Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]ip kraj
Ruch Radzionków
post
Post #1





Grupa: Zarejestrowani
Postów: 311
Pomógł: 25
Dołączył: 29.08.2011

Ostrzeżenie: (0%)
-----


witam ściągnełem z tej strony http://www.642weather.com/weather/ip-to-country.php skrypt ip to country i mam problem zrobiłem wszystko tak jak było w instrukcji i jak wpisze ip to pokaze mi ip i host ale nie pokaze z jakiego kraju jest. co musiał bym zrobic zeby mi kraj pokazalo. albo macie jakis inny skrypt pokazujacy z kad jest dane ip


--------------------
Pomogłem daj pomógł
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
pedro84
post
Post #2





Grupa: Nieautoryzowani
Postów: 2 249
Pomógł: 305
Dołączył: 2.10.2006

Ostrzeżenie: (0%)
-----


MaxMind API


--------------------
Google knows the answer...
Go to the top of the page
+Quote Post
Ruch Radzionków
post
Post #3





Grupa: Zarejestrowani
Postów: 311
Pomógł: 25
Dołączył: 29.08.2011

Ostrzeżenie: (0%)
-----


nie bede tworzył nowego tematu. przerobiłem troche ten skrypt ip to country i mam coś takiego i nie chce mi pokazać kraju oto kod:
  1. <?php
  2. //
  3. //by mit2
  4. //
  5. include('config.php');
  6. $po = '178.213.219.150';
  7. $ip = ctf_clean_input("$po");
  8. $pol = mysql_fetch_array(mysql_query("SELECT * FROM country_info WHERE inet_aton('$ip') >=ip_from AND inet_aton('$ip') <=ip_to"));
  9. echo $pol[country_code2];
  10. function ctf_clean_input($string) {
  11. if (is_string($string)) {
  12. return trim(ctf_sanitize_string(strip_tags(ctf_stripslashes($string))));
  13. } elseif (is_array($string)) {
  14. reset($string);
  15. while (list($key, $value) = each($string)) {
  16. $string[$key] = ctf_clean_input($value);
  17. }
  18. return $string;
  19. } else {
  20. return $string;
  21. }
  22. }
  23. function ctf_sanitize_string($string) {
  24. $string = ereg_replace(' +', ' ', trim($string));
  25. return preg_replace("/[<>]/", '_', $string);
  26. }
  27. function ctf_stripslashes($string) {
  28. return stripslashes($string);
  29. } else {
  30. return $string;
  31. }
  32. }
  33. ?>


--------------------
Pomogłem daj pomógł
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 11:34