• 06-05-2022, 18:42:10
    #1
    Üyeliği durduruldu
    Bu kodu tıklandığında .txt yazdıracak hale nasıl getirebilirim php bilenler yardımcı olabilir mi

    function ipAl() {    if (!empty($_SERVER['HTTP_CLIENT_IP']))    {        $aypi=$_SERVER['HTTP_CLIENT_IP'];    }    elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //proxy,vpn vb. deaktif eder..        {        $aypi=$_SERVER['HTTP_X_FORWARDED_FOR'];    }    else    {        $aypi=$_SERVER['REMOTE_ADDR'];    }  }
    echo "Gerçek IP: ".getRealIpAddr();
    print_r "<h4 style="color:Red;">İp Adresi</h4>".ipAl();
  • 06-05-2022, 18:48:40
    #2
    Hocam bu işi öğrenmek istiyormusun
  • 06-05-2022, 18:59:18
    #3
    $file = fopen('ip.txt', 'a');
    
    fwrite(ipAl());
    
    fclose($file);
    böyle olabilirmi acaba
  • 06-05-2022, 19:25:26
    #4
    $ip = isset($_SERVER['HTTP_CLIENT_IP'])     ? $_SERVER['HTTP_CLIENT_IP']     : (isset($_SERVER['HTTP_X_FORWARDED_FOR'])       ? $_SERVER['HTTP_X_FORWARDED_FOR']       : $_SERVER['REMOTE_ADDR']);
    $myfile = fopen("ip.txt", "a") or die("ip dosyası açılamadı!");
    $txt = $ip . "\n";
    fwrite($myfile, $txt);
    fclose($myfile);