Document

Steph's code for the $_SERVER Array

This is what the $_SERVER array contains

Array
(
    [CONTEXT_DOCUMENT_ROOT] => /home/salzburs/public_html
    [CONTEXT_PREFIX] => /~salzburs
    [DOCUMENT_ROOT] => /var/www/html
    [GATEWAY_INTERFACE] => CGI/1.1
    [HTTPS] => on
    [HTTP_ACCEPT] => */*
    [HTTP_ACCEPT_ENCODING] => gzip, br, zstd, deflate
    [HTTP_HOST] => citw.lcc.edu
    [HTTP_USER_AGENT] => Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
    [HTTP_X_HTTPS] => 1
    [PATH] => /bin:/usr/bin
    [PHP_INI_SCAN_DIR] => /opt/cpanel/ea-php82/root/etc:/opt/cpanel/ea-php82/root/etc/php.d:.
    [QUERY_STRING] => 
    [REDIRECT_STATUS] => 200
    [REMOTE_ADDR] => 216.73.216.193
    [REMOTE_PORT] => 12617
    [REQUEST_METHOD] => GET
    [REQUEST_SCHEME] => https
    [REQUEST_URI] => /~salzburs/citw185/week7/ServerArray.php
    [SCRIPT_FILENAME] => /home/salzburs/public_html/citw185/week7/ServerArray.php
    [SCRIPT_NAME] => /~salzburs/citw185/week7/ServerArray.php
    [SCRIPT_URI] => https://citw.lcc.edu/~salzburs/citw185/week7/ServerArray.php
    [SCRIPT_URL] => /~salzburs/citw185/week7/ServerArray.php
    [SERVER_ADDR] => 172.31.5.10
    [SERVER_ADMIN] => arseneac@star.lcc.edu
    [SERVER_NAME] => citw.lcc.edu
    [SERVER_PORT] => 443
    [SERVER_PROTOCOL] => HTTP/1.1
    [SERVER_SIGNATURE] => 
    [SERVER_SOFTWARE] => Apache
    [SSL_TLS_SNI] => citw.lcc.edu
    [TZ] => America/Detroit
    [UNIQUE_ID] => atZkD1w4WNCQIDm19UnWrwAAANg
    [PHP_SELF] => /~salzburs/citw185/week7/ServerArray.php
    [REQUEST_TIME_FLOAT] => 1792435215.1103
    [REQUEST_TIME] => 1792435215
    [argv] => Array
        (
        )

    [argc] => 0
)

Your Browser is: Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>PHP Server Array</title>
    <link rel="stylesheet" href="../css/assignmentHeaderStyles.css" />
</head>
<body>

<?php
include('../header/assignmentHeader.php');

error_reporting(E_ALL);

echo(
'<h1>Steph\'s code for the $_SERVER Array</h1>');

echo(
'<h2>This is what the $_SERVER array contains</h2>');

echo(
'<pre>');
print_r($_SERVER);
echo(
'</pre>');

$browser = $_SERVER['HTTP_USER_AGENT'] ?? 'Unknown';

echo(
"<p>Your Browser is: " . htmlspecialchars($browser) . "</p>");

show_source(__FILE__);

include(
'../footer/footer.php');
?>

</body>
</html>