Edgars_Grinvalds Posted May 19, 2003 Report Share Posted May 19, 2003 :blink: Tjipa shis skripts nolasa no direktorijas bildes, un pec tam tas izdrukaa, bet kaa lai izveido, lai bildes buutu katraa rindaa tikai cetras? <html> <head> </head> <body> <? $dir=opendir("."); while(($fails=readdir($dir)) !=false){ print("<img src="$fails"><br><br>"); } ?> </body> </html> Link to comment Share on other sites More sharing options...
Roze Posted May 19, 2003 Report Share Posted May 19, 2003 <code><font color="#000000"> <font color="#0000CC"><? $dir</font><font color="#006600">=</font><font color="#0000CC">[url=http://lv.php.net/opendir]opendir[/url]</font><font color="#006600">(</font><font color="#CC0000">"."</font><font color="#006600">); </font><font color="#0000CC">$i </font><font color="#006600">= </font><font color="#0000CC">1</font><font color="#006600">; while((</font><font color="#0000CC">$fails</font><font color="#006600">=</font><font color="#0000CC">[url=http://lv.php.net/readdir]readdir[/url]</font><font color="#006600">(</font><font color="#0000CC">$dir</font><font color="#006600">)) !=</font><font color="#0000CC">false</font><font color="#006600">){ print(</font><font color="#CC0000">"<img src="</font><font color="#0000CC">$fails</font><font color="#CC0000">">"</font><font color="#006600">); if(!(</font><font color="#0000CC">$i </font><font color="#006600">% </font><font color="#0000CC">4</font><font color="#006600">)) { echo </font><font color="#CC0000">"<br/><br/>"</font><font color="#006600">; } </font><font color="#0000CC">$i</font><font color="#006600">++; } </font><font color="#0000CC">?> </font> </font> </code> Tikai njem veeraa ka tev pie cikla japieliek veel $fails!='.' & $fails!='..' Link to comment Share on other sites More sharing options...
Edgars_Grinvalds Posted May 20, 2003 Author Report Share Posted May 20, 2003 Pie kura cikla man kas ir j'apieliek Link to comment Share on other sites More sharing options...
Roze Posted May 20, 2003 Report Share Posted May 20, 2003 <code><font color="#000000"> <font color="#0000CC"><? $dir</font><font color="#006600">=</font><font color="#0000CC">[url=http://lv.php.net/opendir]opendir[/url]</font><font color="#006600">(</font><font color="#CC0000">"."</font><font color="#006600">); </font><font color="#0000CC">$i </font><font color="#006600">= </font><font color="#0000CC">1</font><font color="#006600">; while((</font><font color="#0000CC">$fails</font><font color="#006600">=</font><font color="#0000CC">[url=http://lv.php.net/readdir]readdir[/url]</font><font color="#006600">(</font><font color="#0000CC">$dir</font><font color="#006600">)) !=</font><font color="#0000CC">false</font><font color="#006600">){ if(</font><font color="#0000CC">$fails</font><font color="#006600">!=</font><font color="#CC0000">'.' </font><font color="#006600">&& </font><font color="#0000CC">$fails</font><font color="#006600">!=</font><font color="#CC0000">'..'</font><font color="#006600">) { print(</font><font color="#CC0000">"<img src=</font><font color="#006600">"</font><font color="#CC0000">$fails</font><font color="#006600">"</font><font color="#CC0000">>"</font><font color="#006600">); if(!(</font><font color="#0000CC">$i </font><font color="#006600">% </font><font color="#0000CC">4</font><font color="#006600">)) { echo </font><font color="#CC0000">"<br/><br/>"</font><font color="#006600">; } </font><font color="#0000CC">$i</font><font color="#006600">++; } } </font><font color="#0000CC">?> </font> </font> </code> Link to comment Share on other sites More sharing options...
Recommended Posts