-1

I am trying to create a site, where user can create his account and automatic create his folder in my host.
I write this :

$addtothedb="INSERT INTO login(firstname,lastname,useremail,password,Gender,Dateofbirth) VALUES ('". $fristname . "','". $laname ."','" . $email . "','". $pass ."')" ;          
$result=mysqli_query($con,$addtothedb);
$cur = "USERS/";
$gofile=$cur.$email;
if($result){
   if ( mkdir($gofile,0777) ) {
     } else {
      }
   echo "  Account Successfully Created. <br> Now you can Login. ";                       
  } 
  else {
   echo "<center>Failure</center>";
}

So now he uploads his photos. I want that photos go to his folder not in USERS/ Directory. I try this script but doesnt work, how I want.

<?php
     $con = mysqli_connect("localhost","root","","test");
     echo $_SESSION['name']."<br />" ;  
    $cur = "USERS/";
    $gofile=$cur .$_SESSION["name"];
    echo $gofile;

    $des= dirname($gofile.'/'.$_SESSION['name']);echo "<br/>";  
    echo $des;
?>
4

2 に答える 2