Hallo liebe Community.
Folgendes: Ich erstelle mit HTML, CSS und natürlich der PHP-echo Ausgabe einen Banner.
Ich habe dazu noch die Variable $bannerid und dazugehörige if-Struktur:
Wenn ich die bannerid manuell ändere und die Seite neu lade, passt sich alles super an. Kein Problem.
Aber natürlich will ich das ganze noch automatisch. Ich habe es schon mit einer for-Schleife probiert, das einzige, was ich dabei aber erreichte, war eine Seite, die lud, lud und lud.
Habt ihr noch Ideen?
LG,
Auran
Folgendes: Ich erstelle mit HTML, CSS und natürlich der PHP-echo Ausgabe einen Banner.
Ich habe dazu noch die Variable $bannerid und dazugehörige if-Struktur:
PHP-Code:
<?php
$img1 = "diabloIII.png";
$img2 = "armaIII.png";
$img3 = "guildwars.png";
$img4 = "wildstar.png";
$img5 = "teso.png";
$img6 = "minecraft.png";
$imgheight = "88px";
$unterbrechung = 5;
$bannerid = 2;
echo '
<div id="banner">
<div class="tl">';
if ($bannerid == "1") {
echo '<img src="',$img1,'" style="height:',$imgheight,'; width: auto;"/>';
}
elseif ($bannerid == "2") {
echo '<img src="',$img2,'" style="height:',$imgheight,'; width: auto;"/>';
}
elseif ($bannerid == "3") {
echo '<img src="',$img3,'" style="height:',$imgheight,'; width: auto;"/>';
}
elseif ($bannerid == "4") {
echo '<img src="',$img4,'" style="height:',$imgheight,'; width: auto;"/>';
}
elseif ($bannerid == "5") {
echo '<img src="',$img5,'" style="height:',$imgheight,'; width: auto;"/>';
}
elseif ($bannerid == "6") {
echo '<img src="',$img6,'" style="height:',$imgheight,'; width: auto;"/>';
};
echo '
</div>
<div class="tr">';
if ($bannerid == "1") {
echo '<img src="',$img6,'" style="height:',$imgheight,'; width: auto;"/>';
}
elseif ($bannerid == "2") {
echo '<img src="',$img1,'" style="height:',$imgheight,'; width: auto;"/>';
}
elseif ($bannerid == "3") {
echo '<img src="',$img2,'" style="height:',$imgheight,'; width: auto;"/>';
}
elseif ($bannerid == "4") {
echo '<img src="',$img3,'" style="height:',$imgheight,'; width: auto;"/>';
}
elseif ($bannerid == "5") {
echo '<img src="',$img4,'" style="height:',$imgheight,'; width: auto;"/>';
}
elseif ($bannerid == "6") {
echo '<img src="',$img5,'" style="height:',$imgheight,'; width: auto;"/>';
};
echo '
</div>
<div class="br">';
if ($bannerid == "1") {
echo '<img src="',$img5,'" style="height:',$imgheight,'; width: auto;"/>';
}
elseif ($bannerid == "2") {
echo '<img src="',$img6,'" style="height:',$imgheight,'; width: auto;"/>';
}
elseif ($bannerid == "3") {
echo '<img src="',$img1,'" style="height:',$imgheight,'; width: auto;"/>';
}
elseif ($bannerid == "4") {
echo '<img src="',$img2,'" style="height:',$imgheight,'; width: auto;"/>';
}
elseif ($bannerid == "5") {
echo '<img src="',$img3,'" style="height:',$imgheight,'; width: auto;"/>';
}
elseif ($bannerid == "6") {
echo '<img src="',$img4,'" style="height:',$imgheight,'; width: auto;"/>';
};
echo '
</div>
<div class="bl">';
if ($bannerid == "1") {
echo '<img src="',$img4,'" style="height:',$imgheight,'; width: auto;"/>';
}
elseif ($bannerid == "2") {
echo '<img src="',$img5,'" style="height:',$imgheight,'; width: auto;"/>';
}
elseif ($bannerid == "3") {
echo '<img src="',$img6,'" style="height:',$imgheight,'; width: auto;"/>';
}
elseif ($bannerid == "4") {
echo '<img src="',$img1,'" style="height:',$imgheight,'; width: auto;"/>';
}
elseif ($bannerid == "5") {
echo '<img src="',$img2,'" style="height:',$imgheight,'; width: auto;"/>';
}
elseif ($bannerid == "6") {
echo '<img src="',$img3,'" style="height:',$imgheight,'; width: auto;"/>';
};
echo '
</div>';
?>
Aber natürlich will ich das ganze noch automatisch. Ich habe es schon mit einer for-Schleife probiert, das einzige, was ich dabei aber erreichte, war eine Seite, die lud, lud und lud.
Habt ihr noch Ideen?
LG,
Auran
Kommentar