0

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;
    ?>
2
Contributors
6
Replies
50
Views
2 Years
Discussion Span
Last Post by phoenix254
0

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

0

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

1

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.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.