client-informatie

Gesponsorde koppelingen

PHP script bestanden

  1. client-informatie

« Lees de omschrijving en reacties

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?
    //--- set easy vars!
    $ipaddr = $_SERVER['REMOTE_ADDR'];
    $date = date('d/m/Y');
    $time = date('H.i.s');

    //--- set languages
    $lang['nl'] = "The Netherlands";
    $lang['us'] = "United States of America";
    $lang['hu'] = "Hungarian";
    $lang['de'] = "Germany";
    $lang['fr'] = "France";
    $lang['be'] = "Belgium";
    $lang['au'] = "Australia";
    $lang['se'] = "Sweden";
    $lang['fi'] = "Finland";
    $lang['uk'] = "United Kingdom";

    //--- get country from hostname!
    $hostname = gethostbyaddr($ipaddr);
    $hostname_slizes = explode('.', $hostname);
    $count_slizes = count($hostname_slizes);
    $piece = $count_slizes - 1;
    $extention = $hostname_slizes[$piece];

    //--- check if country code is defined above
    if ($lang[$extention])
        $language = $lang[$extention];
    else
        $language = "Unknown";

    //--- set platforms
    $agent['windows'] = "Windows";
    $agent['mac'] = "Macinotosh";
    $agent['linux'] = "Linux";
    $agent['unix'] = "Unix";

    //-- define user agent
    $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);

    foreach($agent as $key => $value)
    {

        if (preg_match("/" . $key . "/", $user_agent))
            $platform = $agent[$key];
    }

    if (!$platform)
        $platform = "Unknown";

    //--- echo die sjit!
    echo "<p>Client IP: " . $ipaddr . "<br />";
    echo "Client language: " . $language . "<br />";
    echo "Client platform: " . $platform . "<br />";
    echo "Client time: " . $time . "<br />";
    echo "Client date: " . $date . "</p>";
?>

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.