PHP Home

01 Includes 01.01 Random Image

Favorite Fruits

Dragon Fruit
Dragon Fruit

$i = random_int(0, count($images)-1);

                
0                
            

print_r($images);

                
Array
(
    [0] => Array
        (
            [file] => dragonfruit.webp
            [caption] => Dragon Fruit
        )

    [1] => Array
        (
            [file] => kumquats.webp
            [caption] => Kumquats
        )

    [2] => Array
        (
            [file] => mango.webp
            [caption] => Mango
        )

    [3] => Array
        (
            [file] => raspberry.webp
            [caption] => Raspberry
        )

)
                
            

print_r($imageSize);

                

Warning: getimagesize(): open_basedir restriction in effect. File(/php/assignments/01-includes/images/dragonfruit.webp) is not within the allowed path(s): (/var/www/vhosts/kkonshak.bitweb1.nwtc.edu/:/tmp/) in /var/www/vhosts/kkonshak.bitweb1.nwtc.edu/httpdocs/php/assignments/01-includes/01.01-random-image.php on line 28

Warning: getimagesize(/php/assignments/01-includes/images/dragonfruit.webp): Failed to open stream: Operation not permitted in /var/www/vhosts/kkonshak.bitweb1.nwtc.edu/httpdocs/php/assignments/01-includes/01.01-random-image.php on line 28
$_SERVER["SCRIPT_NAME"]
/php/assignments/01-includes/01.01-random-image.php
print_r($_GET)
Array
(
)
print_r($_POST)
Array
(
)
print_r($_SESSION)
Array
(
)
print_r($_FILES)
Array
(
)


<?php
$tools 
true// Robert's Custom Variable (Do Not Use)
include("{$_SERVER["DOCUMENT_ROOT"]}/php/includes/header.php");
?>
<main>
    <h2><?= $folder_name ?>
        <span><?= $file_name?></span>
    </h2>
    <h2>The History of PHP</h2>
</main>
<?php
include("{$_SERVER["DOCUMENT_ROOT"]}/php/includes/sidebar.php");
?>
</body>
</html>