Seite 1 von 1

Bild mit Link

Verfasst: Di 17. Feb 2009, 16:55
von rw72
Hallo,

nutze folgenden Code:

Code: Alles auswählen

<?php
if ("CMS_IMG[2]" != "") {
    $img = '<img src="CMS_IMG[2]" border="0">';
    echo $img;
}
echo "<br>";
echo "CMS_IMGDESCR[2]";
echo "<br>";
echo "CMS_LINKDESCR[2]";
?>
Wie kann ich es umstellen das man das Bild als Link hat?

DANKE

Re: Bild mit Link

Verfasst: Di 17. Feb 2009, 23:28
von gruhle
Hallo rw72,

probiers mal hiermit:

Code: Alles auswählen

<?php
if ("CMS_IMG[1]" != "") {
    $link = 'CMS_LINK[1]';
    $img = '<img src="CMS_IMG[1]" border="0">';
    if ($link != "http://") {
        echo '<a href="CMS_LINK[1]">'.$img.'</a>';
    } else {
        echo $img;
    }
}
?>
Gruß

Reiner