コード例 #1
0
<?php

require "validate.php";
header('Content-Type: video/mp4');
$id = (int) $_REQUEST['id'];
$uagent = $_SERVER['HTTP_USER_AGENT'];
$uagentok = validateUserAgent($uagent, $uagentmsg);
if ($uagentok) {
    $msg = 'OK: ' . htmlspecialchars($uagentmsg);
} else {
    $msg = 'User agent ' . htmlspecialchars($uagent) . ' is invalid: ' . htmlspecialchars($uagentmsg);
}
echo $msg;
$dir = '_results';
$fp = fopen($dir . '/' . $id, 'wt');
fputs($fp, $msg);
fclose($fp);
$fp = opendir($dir);
while (false !== ($fnam = @readdir($fp))) {
    if ($fnam != '.' && $fnam != '..') {
        $files[] = $fnam;
    }
}
@closedir($fp);
$deltime = time() - 3600;
foreach ($files as $dummy => $fnam) {
    $fpath = "{$dir}/{$fnam}";
    if (filemtime($fpath) < $deltime) {
        unlink("{$dir}/{$fnam}");
    }
}
コード例 #2
0
      <p>
        This page shows you crucial information the Web Panel needs to function proper.<br/>
        If any of these show up red, you should check out the issue or find help on our <a
            href="https://community.phantombot.net">Forum</a>.
      </p>
      <h3>You</h3>
      <p>
        Your IP Address: <?php 
echo $clientIp;
?>
<br/>
        <span class="text-muted">As seen from the webserver.</span>
      </p>
      <p>
        Your browser: <?php 
echo validateUserAgent($browser);
?>
<br/>
        <span class="text-muted">If this is yellow the PhantomBot team cannot guarantee that the Web Panel will function proper.</span>
      </p>
      <p>
        Your platform: <span class="text-success"><?php 
echo $browser->getPlatform();
?>
</span><br/>
        <span class="text-muted">This might help when posting issues on the forums.</span>
      </p>
      <h3>Webserver</h3>
      <p>
        Internet connection: <?php 
echo yesNoText($serverHasInternet);