I'm using this code below running perfect with an image loop coming from the DB.
<div align="center" u="slides" style="cursor: move; position: absolute; left: 0px; top: 0px; width: 600px; height: 300px; overflow: hidden;">
<?php
include "conexao.php";
$imagem = $_POST['imagem'];
$texto = $_POST['texto'];
$query = mysql_query("SELECT * FROM banner ORDER BY RAND() LIMIT 4");
while($res = mysql_fetch_array($query)){
?>
<div>
<img src="img_banner/<?php echo $res['imagem']; ?>" alt="image slider" />
<div u=caption t="*" class="captionOrange_" style="position:absolute; left:20px; top: 30px; width:300px; height:30px;">
<?php echo $res['texto']; ?>
</div>
</div>
<?php } ?>
</div>
But I'm trying to create a simulator and I would like to adapt this loop above so that it works in the code below that is bringing the $ _SESSION images.
<div align="center" u="slides" style="cursor: move; position: absolute; left: 0px; top: 0px; width: 600px; height: 300px; overflow: hidden;">
<?php
// Inicio da Sessão do Banner das páginas menu
@session_start();
if(!isset($_SESSION['banner'])){ // Se a Session não for iniciada
$img01 = 'img_banner/01.png'; // Carrega esse conteúdo
$img02 = 'img_banner/02.png'; // Carrega esse conteúdo
$img03 = 'img_banner/03.png'; // Carrega esse conteúdo
$img04 = 'img_banner/04.png'; // Carrega esse conteúdo
$img05 = 'img_banner/05.png'; // Carrega esse conteúdo
$img06 = 'img_banner/06.png'; // Carrega esse conteúdo
$img07 = 'img_banner/07.png'; // Carrega esse conteúdo
}else{ // Se não
if(isset($_SESSION)) { // Se a Session for iniciada
$img01 = ''.$_SESSION['banner'].''; // Carrega esse conteúdo
}}
?>
<div>
<img src="<?php echo $img01 ?>" alt="image slider" />
</div>
<div>
<img src="<?php echo $img02 ?>" alt="image slider" />
</div>
<div>
<img src="<?php echo $img03 ?>" alt="image slider" />
</div>
<div>
<img src="<?php echo $img04 ?>" alt="image slider" />
</div>
<div>
<img src="<?php echo $img05 ?>" alt="image slider" />
</div>
<div>
<img src="<?php echo $img06 ?>" alt="image slider" />
</div>
<div>
<img src="<?php echo $img07 ?>" alt="image slider" />
</div>
</div>
But I'm not sure how to mount the loop to work, or even how to make it work that way. Using looping in images from $ _SESSION.
If friends can give me a light, I'll be grateful.
To view the banner working with images coming from $ _SESSION, go to: www.simuleseusite.com
Hugs to all.