I did a nono and randomized the background. Works

This commit is contained in:
Kasper Rynning-Tønnesen
2015-01-12 21:21:56 +01:00
parent a7e563679b
commit 119cd02c57
2 changed files with 13 additions and 1 deletions

View File

@@ -34,11 +34,23 @@ foreach($dir as $files){
}
}
$bg = array('bg1.jpg', 'bg2.jpg', 'bg3.jpg', 'bg4.jpg', 'bg5.jpg' ); // array of filenames
$i = rand(0, count($bg)-1); // generate random number size of the array
$selectedBg = "$bg[$i]"; // set variable equal to which random filename was chosen
?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:fb="http://ogp.me/ns/fb#">
<head>
<style type="text/css">
<!--
.bgimage{
background: url(./static/<?php echo $selectedBg; ?>) no-repeat;
}
-->
</style>
<?php include("php/header.php"); ?>
</head>
<body>