ray Posted July 10, 2006 Report Share Posted July 10, 2006 paartaisiiju vienu scriptu, palaizhot atsevishkjaa failaa tas iet ideaali, bet ieliekot ar include citaa, tas neiet un met errorus. scripts shaads: <? $skaits=0; $kont=0; $folder = 'mape/'.$klapas_id.'/bildes'; if($dir = opendir($folder)){ while(($file = readdir($dir)) !== false){ $f = $folder.'/'.$file; if(is_file($f)){ $skaits++; $files[] = $file; } } closedir($dir); } $id = (isset($_GET['id']) ? $_GET['id'] : 0); ?> <? while ($kont<$skaits) { ?> <img src="<?=$folder.'/'.$files[$id]?>" height="100" /> <?=$folder.'/'.$files[$id]?><br /> <? $kont++; $id++; } ?> Kljuudu pazinjojumi ir shaadi: Notice: Undefined index: 3 in R:\galerija.inc on line 21 Notice: Undefined offset: 4 in R:\galerija.inc on line 21 Link to comment Share on other sites More sharing options...
bubu Posted July 10, 2006 Report Share Posted July 10, 2006 Un kas no šiem kļūdu paziņojumiem nav skaidrs? Link to comment Share on other sites More sharing options...
tiy Posted July 10, 2006 Report Share Posted July 10, 2006 paskaties kads tev sanak masivs, neaizmirsti ka . un .. ir ari dir'a ka masiva elementi Link to comment Share on other sites More sharing options...
ray Posted July 10, 2006 Author Report Share Posted July 10, 2006 neviens... jo nesaprotu, kaapeec atsevishkjaa lapaa iet, bet kaa include neiet :/ Link to comment Share on other sites More sharing options...
andrisp Posted July 10, 2006 Report Share Posted July 10, 2006 1. Tās notices ir no galvenā skripta. 2. Pārbaudi vai skripts tiešām tiek klāt mape/'.$klapas_id.'/bildes, jo iespējams, ka tas fails, kurā tu ieinkludoji šo skriptu, nemaz pats netiek klāt šai dirai. 3. Kā arī tiy komentārs Link to comment Share on other sites More sharing options...
v3rb0 Posted July 10, 2006 Report Share Posted July 10, 2006 kājiņas scriptam ir? Link to comment Share on other sites More sharing options...
ray Posted July 11, 2006 Author Report Share Posted July 11, 2006 1. Tās notices ir no galvenā skripta.2. Pārbaudi vai skripts tiešām tiek klāt mape/'.$klapas_id.'/bildes, jo iespējams, ka tas fails, kurā tu ieinkludoji šo skriptu, nemaz pats netiek klāt šai dirai. 3. Kā arī tiy komentārs skripts tiek klaat, jo manuaali ierakstot to adresi kkur galvenajaa skriptaa viss aiziet normaali un kaa var apskatiities kaads sanaak masiivs? Link to comment Share on other sites More sharing options...
v3rb0 Posted July 11, 2006 Report Share Posted July 11, 2006 print_r($masivs); Link to comment Share on other sites More sharing options...
ray Posted July 11, 2006 Author Report Share Posted July 11, 2006 Masivs sanak: Array ( [0] => faila_nosaukums [1] => faila_nosaukums_2 utt ) Link to comment Share on other sites More sharing options...
Gundars Posted July 11, 2006 Report Share Posted July 11, 2006 Principā ir klūda scriptā: $kont=0; $skaits=3; $id=0 $kont $id 0 0 1 1 2 2 Savukārt, ja $id sākumvērtība =1 (vai lielaka par 0) tad atiecīgi $kont $id 0 1 1 2 2 Index out of bounds PS> Un vispar labāks stils būtu pierakstīt šo sekojoši for ($kont=0;($kont<$skaits) or ($id<$skaits) ;$kont++,$id++) { } Link to comment Share on other sites More sharing options...
Recommended Posts