Initial commit
This commit is contained in:
19
background.php
Executable file
19
background.php
Executable file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
define('IMAGE_PATH', 'images/');
|
||||
|
||||
//background selection
|
||||
$asImages = glob(IMAGE_PATH.'{*.jpg,*.png,*.jpeg,*.gif}', GLOB_BRACE);
|
||||
$sRandomImagePath = $asImages[array_rand($asImages)];
|
||||
|
||||
//get type
|
||||
$sFileInfo = pathinfo($sRandomImagePath);
|
||||
$sExt = strtolower($sFileInfo['extension']);
|
||||
if($sExt=='jpg')
|
||||
{
|
||||
$sExt = 'jpeg';
|
||||
}
|
||||
|
||||
//display image
|
||||
header("Content-type: image/$sExt");
|
||||
echo file_get_contents($sRandomImagePath);
|
||||
Reference in New Issue
Block a user