note 31272 deleted from function.mkdir by aidan
| From: | aidan@php.net | Date: | Sun, 03 Oct 2004 13:34:41 +0000 |
| Subject: | note 31272 deleted from function.mkdir by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-77824@lists.php.net to get a copy of this message | ||
Note Submitter: dan at mathjunkies.com
----
I had a problem with mkdir on my box running safemode -- it didn't work! To get around it, I
used the ftp functions.
<?php
$connection = ftp_connect('someftpsite.com');
$username = 'user';
$pass = 'pass';
$login_result = ftp_login($connection,$username,$pass);
// check to make sure you're connected:
if ((!($login_result)) or (!($connection)))
{
// error....do something
}
else
{
// we're good to go -- the connection was made
ftp_chdir($connection,'/some/dir/');
ftp_mkdir($connection,'anotherdir');
ftp_close($connection);
}
?>
It's not nearly as nice as being able to make the directory with a single function, but if
you're getting funny errors, it may just do the job.
-Dan