i have this simple code put on test,
<?php
$path = "http://".$_SERVER['HTTP_HOST']."/new";
if(mkdir($path, 0755)){print "folder created";}else{print "failed";}
?>
but it doesn't seem to work, what could be wrong?
how do i create a new folder with php code?
Please review the information on the php.net website.
(You need to use the directory PATH not the URL)
Thank you,
FreePgs.com Admin
allright, now i understand that i need to use the dir path instead of url.
my question now is what is the dir path to my account ultra.freepgs.com ?
/fpgs/fpgshttpd/USERNAME/
just change the username
finally i could create new directories. however, i could remove the folder and file i created, this the error i get
Warning: unlink(/fpgs/fpgshttpd/ultra/blog/My_Profile/index.php) [function.unlink]: Permission denied in /home/admin/system.freepgs.com/phpfm/incl/functions.inc.php on line 22
Deleting of folder failed.
This might be caused by insufficient permissions.
how do i remove it? I could not change the folder permission too, came out with a chmod failed error
you would use rmdir() to remove a directory.
also you could try not using the second parameter on mkdir or setting 0777
and make sure you delete the file(s) within the folder first