Jump to content

PHP FTP - Change Default Root Directory


kool_samule

Recommended Posts

Hi Chaps,

 

I have a basic PHP/FTP Application, which will be accessible to some of my company's freelance workers.

// FTP Credentials
$ftpServer = "www.domain.co.uk";
$ftpUser = "UserName";
$ftpPass = "Password";

set_time_limit(0);

// Connect to FTP Server
$conn = @ftp_connect($ftpServer)
or die("Couldn't connect to FTP server");

// Login to FTP Site
$login = @ftp_login($conn, $ftpUser, $ftpPass)
or die("Login credentials were rejected");

 

This will take me to the root of 'www.domain.co.uk', but it will give everyone access to everyone else's folders, which I don't want.

 

Freelance workers have a 'freecode' which is unique to them, so I'm looking for is to change the default 'root' directory to 'www.domain.co.uk/'FREECODE''.

I've tried this already, but I get a connection to FTP error.

 

Is there anyway of getting round this.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.