-
I've figured it out, and it's working now! :D
I used a completely different code:
PHP Code:
$ftp_server = $ftpserver;
$ftp_user = $ftpuser;
$ftp_password = $ftppass;
$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_user, $ftp_password);
if((!$conn_id) || (!$login_result))
{
echo "FTP connection has failed!";
echo "Attempted to connect to $ftp_server for user $ftp_user";
}
@ftp_mkdir($conn_id, '/public_html/profiles/" . $userUsername . "');
$temp = tmpfile();
//Upload the temporary file to server
@ftp_fput($conn_id, '/public_html/profiles/" . $userUsername/$userUsername . ".html', $temp, FTP_BINARY);
ftp_close($conn_id);
This all works fine now and the files and directories are created on submit.
Thanks very much for all of your help John. :)
-
you're welcome. glad you got it working