CaTaLinU Posted February 10, 2012 Share Posted February 10, 2012 <?php //Directorul unde sa caute $director = /Users'; //Un filtru pentru extensie $extensie = 'ini'; //Logare FTP $server_ftp = '93.'; $utilizator_ftp = '[email protected]'; $parola_ftp = 'x'; $conexiune = ftp_connect($server_ftp); ftp_login($conexiune,$utilizator_ftp,$parola_ftp) or die('Logarea FTP a esuat!'); //Setam pe pasiv ftp_pasv($conexiune,true); //Cream lista $fisiere = array(); $fisiere = raw_list('$director'); //Printam rezultatele $i=0; $count=count($fisiere); while($i < $count); print ''.$fisiere[$id].''; $i++; ftp_close($conexiune); endwhile; //Functia raw_list function raw_list($folder) { Global $conexiune; Global $extensie; Global $fisiere; $exntesii = explode(",", $extensie); $list = ftp_rawlist($conexiune, $folder); $anzlist = count($list); $i = 0; while ($i < $anzlist): $split = preg_split("/[\s]+/", $list[$i], 9, PREG_SPLIT_NO_EMPTY); $ItemName = $split[8]; $endung = strtolower(substr(strrchr($ItemName,"."),1)); $path = "$folder/$ItemName"; if (substr($list[$i],0,1) === "d" AND substr($ItemName,0,1) != "."): raw_list($path); elseif (substr($ItemName,0,2) != "._" AND in_array($endung,$extensii)): array_push($files, $path); endif; $i++; endwhile; return $files; } ?> Parse error: syntax error, unexpected T_ENDWHILE in xxxxxxx/vs/conturi.php on line 28 Link to comment https://forums.phpfreaks.com/topic/256831-unexpected-t_endwhile/ Share on other sites More sharing options...
digibucc Posted February 10, 2012 Share Posted February 10, 2012 while should have a colon not semi colon after <?php while($i < $count): print ''.$fisiere[$id].''; $i++; ftp_close($conexiune); endwhile; ?> not <?php while($i < $count); ?> also <?php $director = /Users'; ?> should be <?php $director = '/Users'; ?> also, wrap your code in code tags (there's a button) it makes it easy to read like mine is. Link to comment https://forums.phpfreaks.com/topic/256831-unexpected-t_endwhile/#findComment-1316670 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.