...

View Full Version : Create Dir??



the-dream
03-14-2007, 07:04 PM
I have been doing some reaser on how to create a dir in php. But cat find anything here are the dir functions i have found but cant find any for like creating a dir. Please help. heres what i got so far.

chdir Change directory
chroot Change the root directory
dir Directory class
closedir Close directory handle
getcwd Gets the current working directory
opendir Open directory handle
readdir Read entry from directory handle
rewinddir Rewind directory handle
scandir List files and directories inside the specified path

Nightfire
03-14-2007, 07:09 PM
mkdir
http://uk.php.net/function.mkdir

the-dream
03-14-2007, 07:22 PM
i have this:


<?php
$dir = $_GET['dir'];
mkdir(''.$dir.'', 0777) or die('Sorry Could Not Create Directory!');
?>

how would i first check if the dir already exists???

Inigoesdr
03-14-2007, 07:53 PM
file_exists() (http://www.php.net/manual/en/function.file-exists.php)

Nightfire
03-14-2007, 08:29 PM
is_dir
http://php.net/is_dir

the-dream
03-14-2007, 08:35 PM
thanks,

i have been looking through php.net and cant find a file create function. is there one? if what is it??????

Nightfire
03-14-2007, 08:38 PM
fopen
http://php.net/fopen

aedrin
03-14-2007, 09:07 PM
Please use sites like Google, Live search or Yahoo!

There is no point in asking questions that are easily answered in a search engine.

Inigoesdr
03-14-2007, 09:11 PM
It's on the same page you copied the function list from too, the-dream; two lines above it.

the-dream
03-14-2007, 09:53 PM
Sorry! :(



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum