FreePgs.com Forum

FreePgs Related => Support Requests => Topic started by: robot on August 23, 2006, 09:46:20 AM

Title: how to mkdir()
Post by: robot on August 23, 2006, 09:46:20 AM
i have this simple code put on test,
<?php
$path 
"http://".$_SERVER['HTTP_HOST']."/new";
if(
mkdir($path0755)){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?
Title: Re: how to mkdir()
Post by: admin on August 24, 2006, 11:55:21 PM
Please review the information on the php.net website.

(You need to use the directory PATH not the URL)

Thank you,
FreePgs.com Admin
Title: Re: how to mkdir()
Post by: robot on August 26, 2006, 11:54:22 AM
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 ?
Title: Re: how to mkdir()
Post by: markjay on August 26, 2006, 11:56:30 AM
/fpgs/fpgshttpd/USERNAME/

just change the username
Title: Re: how to mkdir()
Post by: robot on August 26, 2006, 01:14:32 PM
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
Title: Re: how to mkdir()
Post by: Dan on August 26, 2006, 09:16:36 PM
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