News:

The "Support Requests" forum is now viewable by guests.

Main Menu

how to mkdir()

Started by robot, August 23, 2006, 09:46:20 AM

Previous topic - Next topic

robot

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?

admin

Please review the information on the php.net website.

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

Thank you,
FreePgs.com Admin

robot

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 ?

markjay

/fpgs/fpgshttpd/USERNAME/

just change the username

robot

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

Dan

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