Пример #1
0
/**
 * Filters the given domain and split it into an array with a port number.
 *
 * @param   string  $domain
 *
 * @return  array   The domain and the port number.
 */
function filter_domain($domain)
{
    // Convet IDN domain to ascii (if required)
    $domain = convert_idn_domain($domain);
    $domain = preg_replace("/[^A-Za-z0-9-\\/\\.\\:]/", "", $domain);
    // Split the variable into two, $domain & $port.
    $result = explode(":", $domain);
    // If the port is not numeric or not set we use port 80.
    if (!isset($result[1]) || !is_numeric($result[1])) {
        $result[1] = 80;
    }
    return $result;
}
Пример #2
0
<?php

require "settings.php";
require "functions.php";
// Split the variable into two, $domain & $port.
list($domain, $port) = filter_domain($_GET["domain"]);
// Check the site and get the response code.
$data = get_response($domain, $port);
// Check if IDN domain - convert, display correct domain name in HTML
$domain = convert_idn_domain($domain);
// Caluate and format the time taken to connect.
$time = round($data["time"], 3);
$id = gen_id($data);
$title = gen_title($id, $domain);
$html = gen_html($id, $domain, $port, $time, $data["code"]);
?>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>

    <title><?php 
echo $title . " // isitup.org";
// display the dynamic title
?>
</title>

    <!-- Hi r/ProgrammerHumor :wave:! -->

    <!-- Meta Info -->
    <meta name="description" content="The availability results for <?php