I have this code making a random image:
public function RandomImage( $strLeftDirName )
{
if ( !is_string( $strLeftDirName ) )
{
return false;
}
$left_dir = DataObject::get_one("Folder", "Name = \"$strLeftDirName\"");
$randImg = ( $left_dir->ID ) ? DataObject::get_one("Image", "ParentID = $left_dir->ID", true, "RAND()" ) : false;
return $randImg->Filename;
}
But how would I make it a random background image on a div?
I want to be able to apply it to my header if possible?