Novahq.net Forum

Novahq.net Forum (https://novahq.net/forum/index.php)
-   Web design and Programming (https://novahq.net/forum/forumdisplay.php?f=32)
-   -   Folders? (https://novahq.net/forum/showthread.php?t=8796)

BeBop 07-09-2003 11:11 AM

Folders?
 
is there a way to use like a form to create a folder with teh name of that form in it? probably using i/o functions in php?
if any one knows what im talkin about please respond.

Lakie 07-10-2003 02:24 AM

1 Attachment(s)
Ok this will create a folder in the directory you upload this to, this is my forst piece of php code YES!!!!

You need to chmod the file and directory you place this into i did it to 777

This is only the most basic code, if you come back soon and if i can get it to work ill put in a bit more like a confirmation

Lakie 07-10-2003 03:15 AM

1 Attachment(s)
k ive updated it for you and it still works!

now it will check to see if the folder is already there, and if it is will aks for a different name, also gives confirmation.

SilentTrigger 07-10-2003 11:28 AM

PHP Code:

<?php

$test 
is_dir("$FolderName");  //seeing if folder exists
if ($test//found a folder
    
{  
        echo 
"folder already exists,please choose a different name";
}


if (
$submit == "click"){ 
  
mkdir ("$FolderName");
print(
"All done, the folder has been created");
}
else{
echo
'
  <html><body> 

  <form method="post" action="input.php"> 

  Enter Your Desired Folder Name 
  <input type="text" name="FolderName"></input><br> 

  <input type="submit" name="submit" value="click"></input> 

  </form> 

  </body></html> 
  '

 
}

?>

Why do you have $Submit == "click"?
Should be enough with, if($Submit)...
Looks like a good script :)

BeBop 07-10-2003 01:36 PM

ty man


All times are GMT -5. The time now is 03:04 AM.

Powered by vBulletin®