breksis Posted December 20, 2004 Report Share Posted December 20, 2004 Es gribeetu uztaisiit taa, lai katru reizi ieejot lapaa, izmainaas bilde, kas man atrodas augsheejaa stuurii, kaa tu panaakt?? Link to comment Share on other sites More sharing options...
Venom Posted December 20, 2004 Report Share Posted December 20, 2004 es panākt ātri ;) <?php $bildes=10; echo '<img alt="" src="bilde_'.rand(0,$bildes).'.jpg" />'; ?> bildes nosaukt kā bilde_1.jpg, bilde_2.jpg... Link to comment Share on other sites More sharing options...
parrymason Posted March 20, 2005 Report Share Posted March 20, 2005 es panākt ātri ;) <?php $bildes=10; echo '<img alt="" src="bilde_'.rand(0,$bildes).'.jpg" />'; ?> bildes nosaukt kā bilde_1.jpg, bilde_2.jpg... 12362[/snapback] Labs, es pamēģināju, bet bija gadījumi, kad neparādās neviena bilde. Aizvietoju rand(0,$bildes) ar rand(1,$bildes) un viss iet. Link to comment Share on other sites More sharing options...
rudzis Posted March 20, 2005 Report Share Posted March 20, 2005 mans panaakt taapat ar rand(1, $bildes) un paraadaas vienmeer, ja nu vieniigi tev ir arii bilde_0.jpg. Link to comment Share on other sites More sharing options...
Recommended Posts