Jump to content
php.lv forumi

Auto change


Snaip3Rs

Recommended Posts

Līdz pilnībai man trūks salabot pēdējo skriptu!

Man ir lūk šāds vienkārš skripts!

<?php
$url = "/img/";
$monImage = "$url"."7.jpg";
$tueImage = "$url"."8.jpg";
$wedImage = "$url"."9.jpg";
$thurImage = "$url"."10.jpg";
$friImage = "$url"."11.jpg";
$weekendImage = "$url"."12.jpg";
$d = date("D");

switch ($d)
{
case Mon:
echo "<img src=$monImage width=160 height=200>\n";
break;
case Tue:
echo "<img src=$tueImage width=160 height=200>\n";
break;
case Wed:
echo "<img src=$wedImage width=160 height=200>\n";
break;
case Thu:
echo "<img src=$thurImage width=160 height=200>\n";
break;
case Fri:
echo "<img src=$friImage width=160 height=200>\n";
break;
default:
echo "<img src=$weekendImage width=160 height=200>\n";
}
?>

 

Kā var uztaisīt lai nebūtu man katru nedēļu jānumurē bildes bet viņas liktos pēc dienām uz jauno gadu 356.jpg piemēram tā!

Un lai varētu viņu palielināt uzklikšķinot!

Link to comment
Share on other sites

  • 1 month later...

Lūkur ir tas kods,

echo "<img src='/img/'".$url.date('z').".jpg' width=160 height=200>\n";

bet kā uztaisīt lai būtu autopalielināšana kad uzklikšķina un border 2

 

<a href="bilde"><img src="bilde" width="160" height="200"/></a>

Link to comment
Share on other sites

ja tu lieto $url, tad priekškam vēl priekšā liec /img/ ?

to jau tu esi norādījis un 2reiz to nevajag.

 

echo "<a href='/img/lielābilde-".date('z').".jpg'><img src='/img/'".date('z').".jpg' width=160 height=200></a>\n";

Edited by eude
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...