hi,
well I'm playing around with some php ftp commands.
but here's my questions, actually two of them.
- I'm tryin to make it so that if, in a listing of directories and files, the current selected thing is a directory, it does one thing, and if it is a file, it does another.
here's my code right now:
$list = ftp_nlist($conn_id, $dir);
foreach ($list as $l) {
echo "<a href=\"".path."?host=".$host."&username=".$user."&password=".$pass."&dir=".$l."\">".basename($l)."</a>\n<br />\n";
}
which lists all of the files and directories, and if one of those links are clicked on, then it changes to that directory. but if it isn't a directory and is a file instead I want the link to say &file=".$l." instead of &dir=".$l." so that I can do different things with that. how do you do that? I was thinking about looking at the net_ftp's code since I have that running too but that is all big and confusing usually.so...
- it seems that th eonly option is to connect to the ftp again each time another page loads. like if you click on one link, that ftp stream isn't existent anymore, so then you'd have to create all of that again, right? there is no way around having to reconnect each time a page loads? just wondering, or what was the best way to do this.
Brandon