Miscellaneous > Programming & Networking

quick php question

(1/2) > >>

Stryker:
How can I create a directory using php without useing the system() function? (the host disabled system()) Sorry to be so short, but i'm going to go see if I can find it (again), thanks.

voidmain:
mkdir("/some/dir",755);

Or if you have ftp access you might be able to create the directory through FTP and chmod it depending on if your host allows it.

[ January 18, 2003: Message edited by: void main ]

Stryker:

quote:Originally posted by void main:
mkdir("/some/dir","755");

Or if you have ftp access you might be able to create the directory through FTP and chmod it depending on if your host allows it.
--- End quote ---


i cant use ftp or anything like that... i am making an automated page for adding users to the .htpasswd file of my site, and then giving them an upload directory. ftp would be difficult to automate, but i'll try that mkdir() though.

voidmain:
Oh, thought it was a one time thing. Yeah, I made a mistake in the mkdir() syntax. You need 4 octal mode chars. For instance to make a directory with full access for everyone (rwxrwxrwx) you would:

mkdir("/some/dir",0777);

[ January 18, 2003: Message edited by: void main ]

Stryker:
it made the dir, i chosoe permissions 777 (i have reasons dont worry), but the permissions are all set to nothing except for the owner, which is apache. i can't chmod from the shell, because it's not mine. any ideas why the permissions didn't set right and how to fix it? (i'm not just asking, i've been looking)

Navigation

[0] Message Index

[#] Next page

Go to full version