Invisible Shadow Posted March 21, 2009 Report Share Posted March 21, 2009 Vai kāds varētu pateikt, kā var uzlikt mājaslapai mainīgus logo? Piem. refrešo lapu, mainās logo augšā. Lūdzu palīdzat man. Paldies. Link to comment Share on other sites More sharing options...
ICEclan Posted March 21, 2009 Report Share Posted March 21, 2009 Nu var jau uztaisīt kā animāciju. Link to comment Share on other sites More sharing options...
X ID Posted March 21, 2009 Report Share Posted March 21, 2009 2 vienkāršākie varianti: 1) saliec visus logo mapītē logo ar nosaukumiem 1.gif, 2.gif, 3.gif, etc PHP <? $logos =3; // logo skaits echo '<img src="/logo/',rand(1,$logos),'.gif" alt="" />'; ?> 2) Izveido masīvu ar pieejamajiem logo failiem PHP <? $logos =array('/images/logo_1.jpg','/img/bilde.gif','/logo/3.png'); // visus pieejamos logo failus sarakstam masīvā echo '<img src="',$logos[array_rand($logos)],'" alt="" />'; ?> Link to comment Share on other sites More sharing options...
w4p1337 Posted March 21, 2009 Report Share Posted March 21, 2009 $logo = rand(1,3); echo "<img src='".$logo.".jpg' />"; Link to comment Share on other sites More sharing options...
DoubleT Posted March 21, 2009 Report Share Posted March 21, 2009 man jau labāk masīvu variants patīk tad vismaz var *.jpg *.gif *.png *.bmp i.t.d Link to comment Share on other sites More sharing options...
Invisible Shadow Posted March 21, 2009 Author Report Share Posted March 21, 2009 1) saliec visus logo mapītē logo ar nosaukumiem 1.gif, 2.gif, 3.gif, etc <? $logos=array('/images/logo_1.jpg','/img/bilde.gif','/logo/3.png');?//?visus?pieejamos?logo?failus?sarakstam?masīvā echo?'<img?src="',$logos[array_rand($logos)],'"?alt=""?/>'; ?>[/php] Šito uzliku, viss iet, varat slēgt ciet Link to comment Share on other sites More sharing options...
Kavacky Posted March 22, 2009 Report Share Posted March 22, 2009 Baigi vajag... Link to comment Share on other sites More sharing options...
Recommended Posts