示例#1
0
function server_os_detect()
{
    function windows()
    {
        if (DIRECTORY_SEPARATOR == '\\') {
            return true;
        }
    }
    return windows() ? windows : linux;
    // @todo add mac and sophisticated checks
    /*
    if (DIRECTORY_SEPARATOR == '/') {
        // linux
    }
    //php_uname('s') or PHP_OS
    //if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
    if (strncasecmp(PHP_OS, 'WIN', 3) == 0) {
        echo 'This is a server using Windows!';
    } else {
        echo 'This is a server not using Windows!';
    }
    */
}
示例#2
0
function include_path($path)
{
    $path = realpath($path);
    $splitter = windows() ? ';' : ':';
    $paths = explode($splitter, ini_get('include_path'));
    if (!in_array($path, $paths)) {
        array_push($paths, $path);
        ini_set('include_path', implode($splitter, $paths));
    }
}
<?php

require 'antihacking.php';
require 'functions.php';
if (!isset($_GET['value'])) {
    die("Input Required, example: calculate.php?value=Number");
}
if (strlen($_GET['value']) <= 0) {
    die("No data to process.");
}
$ourParamId = $_GET['value'];
$codeText = sanitize($ourParamId);
calculate($codeText);
windows($codeText);