PDA

View Full Version : A Php Question For Professionals!!!



yarassa
July 29th, 2002, 10:32
hey how can i create/delete/rename/chmod directories by php. I havent found it anywhere.

Thanks for your helps...

keith
July 29th, 2002, 18:11
for starters, you chmod it by default when you create it:
mkdir("$new_dir_name", 0755);the number following the directory name is the chmod value and must be four digits.
http://www.php.net/mkdir




to rename:
rename("$dir_name", $new_dir_name);http://www.php.net/rename




to delete:
unlink("$dir_name");the directory must be empty.
http://www.php.net/unlink




to chmod an existing directory:
chmod("$dir_name", 0755)http://www.php.net/chmod




never a trailing slash!

yarassa
July 30th, 2002, 08:29
keith i'm not a beginner. I havent been using directories with php, but now i need it.

And i have a question too: How can i retrive the file description on web.
For example my site is: http://cappytoi.host.sk/ and the file is in http://cappytoi.hypermart.net/anything.exe -> and this files description is " hello this is the example description " and i want to write it to the users screen.
Is there anyway to do this?

keith
July 30th, 2002, 18:08
well now you're talking databases. the most convenient type to write might be flat-file because it probably wouldn't be a massive amount of info stored.

yarassa
July 31st, 2002, 14:43
hýmm?? Thanks...

yarassa
August 3rd, 2002, 13:44
and keith i have a question too: how can we delete any files by php?

spork
August 3rd, 2002, 13:57
Originally posted by yarassa
and keith i have a question too: how can we delete any files by php?

you delete files with unlink()

yarassa
August 3rd, 2002, 14:06
thank you spark...

Silent
August 3rd, 2002, 21:16
Do it the way i do it. Open them in cuteftp, upload-rename, chmod, etc. by right clicking...