PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
if( !$dirContents = opendir($paths['ftphost'] . $paths['binsfolder'] . "/$suiteBin")) {
$ua = "<FONT COLOR=RED><B>There was a problem opening the directory.<FONT></B>";
} else {
// Run code
}
I think the reason is I am trying to access account1 from account2 on the same server using a php script and opendir() seems to through the "not implemented" error, I guess because the server does not permit this access, is there a way I can get around this? I need to count and check file types of files on the other server directory?
Yeah you can't open a directory using the opendir() command that isn't on your server. I think the ftp commands would be more suited for this purpose. They are all pretty self explanitory and can be found in the manual here
You can't read directories over HTTP, you can only read the document the server sends by HTTP.
The way to do what you are trying to achieve *would* be to use the full server path e.g. "/home/account1/public_html/folder/" but then it comes down to security permissions permitting that access to the other account.
As already mentioned, if both accounts are yours the FTP functions will do nicely. You just connect to ftp://localhost with your username and password and yippee, you have access.
Yes that is correct, it is not possible to use the full server path. I have set up two accounts on the same server, a main account called account1 where the site is, and a second account called account2 so when the ftp's the account they can't see other directories such as the site folder as it won't exist.