kostenloser Webspace werbefrei: lima-city


A problem in Making HTTP requests

lima-cityForumSonstigesEnglish

  1. Autor dieses Themas

    starlines2

    Kostenloser Webspace von starlines2

    starlines2 hat kostenlosen Webspace.

    HI

    i have a IP get fonction in my script, wich get the contry flag of the memeber based on his IP, it was before working fine, but after the installation of the new server, it's not working anymore.
    and this is the fonction :

    function modo_ip($ip){
    $site_api = @file_get_contents("http://api.hostip.info/?ip=".$ip);
    preg_match("@<countryAbbrev>(.*?)</countryAbbrev>@si",$site_api,$match);
    $country=$match[1];
    return $country;
    
    mysql_query("INSERT INTO ".prefix."IP SET M_ID = '$DBMemberID', IP = '$ip',DATE = '$date', COUNTRY = '$country' ".$and." ") or die(mysql_error());
    }
    }


    Please is that means that you disabled some PHP focntions like Making HTTP requests.?

    Please can you explain me whay? is that an php function that you disabled, because its just to check the ip in http://api.hostip.info/?ip=".$ip and to get the contry name and flag

    Thnak you>

    Beitrag zuletzt geändert: 15.6.2010 5:02:07 von starlines2
  2. Diskutiere mit und stelle Fragen: Jetzt kostenlos anmelden!

    lima-city: Gratis werbefreier Webspace für deine eigene Homepage

  3. i think the error-causing function is: file_get_contents

    To use this, you need to set
    "allow_url_fopen = On"
    in php.ini

    If it still does not work, try to set
    "user_agent"
    to something, sometimes this helps ...
  4. While the server move is still going on you can't open websites wich are not on this server or reqeust to other servers. Wait a few days and try it agen.
  5. Autor dieses Themas

    starlines2

    Kostenloser Webspace von starlines2

    starlines2 hat kostenlosen Webspace.

    dalabad schrieb:
    i think the error-causing function is: file_get_contents

    To use this, you need to set
    "allow_url_fopen = On"
    in php.ini

    If it still does not work, try to set
    "user_agent"
    to something, sometimes this helps ...


    i guess you are right the aloow_url_fopen now is off, and that fonction allow the HTTP connection and requests.

    but user_agent is to determinate the browser of the user (MIE, FireFox,...etc), the ip you have 2 choices "HTTP_X_FORWARDED_FOR" and "REMOTE_ADDR", and you can check in the phpinfo() of lima-city you will find that the " HTTP_X_FORWARDED_FOR" is not right, because the the localhost ip is always add to the user ip. so "REMOTE_ADDR" is the only choice for you in lima-city.

    Thank you

    While the server move is still going on you can't open websites wich are not on this server or reqeust to other servers. Wait a few days and try it agen.


    Thank you for trying to help me. but after i pm the Admin via a support ticket, thye peoblem is because of some php focntion are disabled (fsockopen, curl),.

    http://www.lima-city.de/thread/derzeitige-ausfaelle-und-zukunft

    unfortuantly, these fonctions are now permanently disabled by default,

    I hope that, these fonction will be opened to who needed to it after the request of the memebr of cours.



    Beitrag zuletzt geändert: 15.6.2010 20:17:02 von starlines2
  6. Diskutiere mit und stelle Fragen: Jetzt kostenlos anmelden!

    lima-city: Gratis werbefreier Webspace für deine eigene Homepage

Dir gefällt dieses Thema?

Über lima-city

Login zum Webhosting ohne Werbung!