Jump to content

PHP mkdir Help

- - - - -

  • Please log in to reply
1 reply to this topic

#1
the_bang

the_bang

    Newbie

  • Members
  • Pip
  • 6 posts
Hi Allz,
Today I have tried to create a simple code work through mkdir,opendir and etc.
Now my code consisting of these :
<?php


  echo "<form action='?do=create' method='post'>

  Create a Directory(Folder) : <input type='text' name='createll'><input type='submit' name='submit' value='Create(!)'>

  

 </form>";

 echo "Directorys Which You Have Uploaded Until Today :<br>";

 $dir = "/creater/";

  $op = opendir($dir);

   while($read = readdir($op)){

   

   echo $read;

   

   }

// Create File Functions

      @$input_crt = $_POST['createll'];

 if(@$_GET['do'] == 'create'){    if($_POST){

	  if(!empty($input_crt)){

	        $crtdir = mkdir($input_crt."_FILE");

			if($crtdir){

			   echo $input_crt." Has Uploaded with Success";

			   header("Refresh:1; url=t3st.php");

			}else {

			echo $input_crt." Has Failed";

			header("Refresh:1; url=t3st.php");

			}

		}else {

	   echo "Label is Empty";

	  header("Refresh:1; url=t3st.php");

	  }}}

// End Of Functions

?>

As You See, in this code : (User) can create a directory in folder which it called CREATER, now i want to that (User) can see directory which he(she) create these,so i added _FILE to end of directory which user will create , and when user want to directory which he created ,he'll searching them with ereg(_FILE) , so my trouble is in $dir variable, how can i do that content of $dir(var) be ("creater") folder, because when mkdir() function work , it will make the folders in the creater folder. Help Plz

#2
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,722 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
Um...what output are you getting?
sudo rm -rf /




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users