0

How to find the following information using php?

Server Information

Server OS Linux
PHP Version 5.4.8
Server Handler fpm-fcgi
Platform windows

Admin Information

IP Address 202.93.141.94
Browser Mozilla Firefox
Version 20.0

Edited by davy_yg

5
Contributors
6
Replies
48
Views
4 Years
Discussion Span
Last Post by davy_yg
0
  1. get server OS name
    http://php.net/manual/en/function.php-uname.php

  2. $_SERVER Indices to get ip of user http://www.php.net/manual/en/reserved.variables.server.php

    function _ip( )
    {
    if (preg_match( "/^([d]{1,3}).([d]{1,3}).([d]{1,3}).([d]{1,3})$/", getenv('HTTP_X_FORWARDED_FOR'))
    {
    return getenv('HTTP_X_FORWARDED_FOR');
    }
    return getenv('REMOTE_ADDR');
    }

  3. $_SERVER Indices to get server software running SERVER_SOFTWARE http://www.php.net/manual/en/reserved.variables.server.php

output :-Apache/2.2.22 (Win64) PHP/5.3.13

Edited by IIM

0

I replace it with this why I still get empty result?

<td>Server OS</td><td><?php $_SERVER['SERVER_NAME']; ?></td>
1

Try:

<td>Server OS</td><td><?php echo $_SERVER['SERVER_NAME']; ?></td>

Edited by Zagga

0

Thanks. How to find the rest of the information:

PHP Version 5.4.8
Server Handler fpm-fcgi
Platform windows

Admin Information

IP Address 202.93.141.94
Browser Mozilla Firefox
Version 20.0

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.