FTP DIRECTORY

From: Date: Sat, 03 May 2003 13:43:37 +0000
Subject: FTP DIRECTORY
Groups: php.general 
Request: Send a blank email to php-general+get-146263@lists.php.net to get a copy of this message
I have this script to the connession to a site but in the options it lists also the dirs.... what could I do? <?Php $ftp_server = $_POST['host']; $ftp_user_name = $_POST['nome_utente']; $ftp_user_pass = $_POST['password']; $conn_id = ftp_connect($ftp_server); $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); if ((!$conn_id) || (!$login_result)) { echo "La connessione FTP è fallita!"; echo "Tentativo di connessione a $ftp_server per l'utente $ftp_user_name"; die; } else { echo "Connesso a $ftp_server, utente $ftp_user_name"; } $cartella = ftp_pwd($conn_id); if ($cartella = "/"){ echo "<br /> Sei nella cartella : Home<br /><br />"; }else{ echo "<br /> Sei nella cartella : $cartella<br />"; } $list=ftp_nlist($conn_id, "$cartella"); $i=0; echo "<form action=\"\" method=\"\"> <select> "; do{ echo "<option>"; echo $list[$i], "</option>"; $i++; }while($list[$i]); echo " </select> </form>"; ?>

« previous php.general (#146263) next »