In my public_html directory I cannot change anything with this php code. I can with my ftp program: ftp navigator. What is going on?
Take note, I can write to the root where public_html is but not inside.
$curdir = dirname(stripslashes($_SERVER["PATH_TRANSLATED"]));
// directory to place thumbnail images
$thumbdir = "thumbnails";
FtpMkdir($curdir, "HI");
if(!is_dir($thumbdir))
{
FtpMkdir($curdir, $thumbdir);
}
function FtpMkdir($path, $newFolderName)
{
$server='ftp.foryouandi.com'; // ftp server
$connection = ftp_connect($server); // connection
$result = ftp_login($connection, "me", "u24v");
if ((!$connection) || (!$result))
{
return false;
exit();
}
else
{
//chmod($path, 0777);
ftp_site($connection, "CHMOD 777 $path");
ftp_chdir($connection, $path); // go to destination dir
if(ftp_mkdir($connection,$newFolderName))
{
ftp_site($connection, "CHMOD 777 $path/$newFolderName");
return $newDir;
}
else
{
return false;
}
ftp_close($conn_id); // close connection
}
Here are the errors:
Warning: ftp_site(): /home/foryouan/public_html/Space: No such file or directory in /home/foryouan/public_html/Space/Thumb.php on line 83
Warning: ftp_chdir(): /home/foryouan/public_html/Space: No such file or directory in /home/foryouan/public_html/Space/Thumb.php on line 84