- Izveidojam php failu, iekšā ievietojam :
Code
<?php
$url = "/bilzhu atrashanas vieta/";
$monImage = "$url"."tavabilde1.jpg";
$tueImage = "$url"."tavvabilde2.jpg";
$wedImage = "$url"."tavabilde3.jpg";
$thurImage = "$url"."tavabilde4.jpg";
$friImage = "$url"."tavabilde5.jpg";
$weekendImage = "$url"."tavabilde6.jpg";
$d = date("D");
switch ($d)
{
case Mon:
echo "<img src=$monImage width=160 height=170>\n";
break;
case Tue:
echo "<img src=$tueImage width=160 height=170>\n";
break;
case Wed:
echo "<img src=$wedImage width=160 height=170>\n";
break;
case Thu:
echo "<img src=$thurImage width=160 height=170>\n";
break;
case Fri:
echo "<img src=$friImage width=160 height=170>\n";
break;
default:
echo "<img src=$weekendImage width=160 height=170>\n";
}
?>
- Tālāk uploadojam "jūsuphpfailu.php" savā ftp serverī.
- Editējam index.php failu, un vietā kur vēlaties redzēt, iekrastam :
Code
<?php include("/jusuphpfails.php"); ?>
- Attiecīgi editējam :
Code
$monImage = "$url"."tavabilde1.jpg";
$tueImage = "$url"."tavvabilde2.jpg";
$wedImage = "$url"."tavabilde3.jpg";
$thurImage = "$url"."tavabilde4.jpg";
$friImage = "$url"."tavabilde5.jpg";