i am trying to create a site, when user create his account then make automatic his directory with his name.
when he wants to upload his photos, these photos go automatic in his folder or directory.
im my register page i have added these lines:

 $addtothedb="INSERT INTO login (firstname,lastname,useremail,password,Gender,Dateofbirth) VALUES ('". $fristname . "','". $laname ."','" . $email . "','". $pass ."','". $sgender . "','". $date . "')" ;          
                $result=mysqli_query($con,$addtothedb);
                $cur = "USERS/";
                $gofile=$cur.$email;

                if($result){
                            if ( mkdir($gofile,0777) ) {

                            } else {

                            }

                        echo " <div id='success'> Account Successfully Created. <br> Now you can Login. </div>";                       
                } 
                else {
                        echo "<div id= 'success_no' ><center>Failure</center></div>";
                }

and this is how i m trying to do it.

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

Recommended Answers

All 6 Replies

And what is the actual problem? Describe where you got stuck and post possible error messages.

i am not getting any error. i want to know how can i send user's data to his folder or dirextory

Do you already have an upload form? If not, you can find nice tutorial here. Make sure that everything is happening within the restricted area (i.e. a user has to be logged in to upload photos), to keep things secure.

An elegant solution would be to use AJAX, so users can upload photos without leaving a page or to put checkboxes to each photo in order to enable users to load more photos at once.

Hopefuly I understood your question right. If not please clarify it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.