_SERVER()


string _SERVER ( string $str )

Description

_SERVER() returns information after searching the web browser’s request.
Can be used to prevent normal script’s execution from being executed by web browsers.

※ available F/W version : all

Parameters

Return values

If the key string is found, returns a value string corresponding to the key string. It returns an empty string if it is not found. Otherwise PHP error.

Examples

<?php
if((bool)_SERVER("REQUEST_METHOD"))
    return; /* avoid php execution via http */

// Normal code will be followed:
?>
<?php
$ret = _SERVER("REQUEST_METHOD");echo "REQUEST_METHOD = $ret<br>";
$ret = _SERVER("REMOTE_ADDR");echo "REMOTE_ADDR = $ret<br>";
$ret = _SERVER("HTTP_USER_AGENT");echo "USER_AGENT = $ret<br>";
?>

See also

None

Remarks

This function is implemented for same operation to the predefined variable $_SERVER of the PHP Group’s PHP.