Jump to content
php.lv forumi

Ludzu Palidziet


Edgars_Grinvalds

Recommended Posts

: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

<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

<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

×
×
  • Create New...