chackers chackers - 5 months ago 18
SQL Question

How can I create a folder in php named as user register and link in mysql ?

How can I create a folder in php named as per username at registration and link in mysql ? After that i want to upload files as per user upload and upload to user's folder.

Answer

Hi You can try something like this

<?php 
if(isset($_POST['submit'])){
    $name= trim($_POST['submit']);
    $email= trim($_POST['email']);
    $username= trim($_POST['username']);
    $password= trim($_POST['password']);
    if($name && $email && $username && password){
    // do what ever you want to do like insert into db etc
    $dirname = "path to you file/".$username;
    mkdir($dirname);        
    }   
}

?>
<form  method='post'>
<legend>Register</legend>
Your Full Name*:<input type='text' name='name'  maxlength="50" /></br>
Email Address*: <input type='text' name='email'' maxlength="50" /></br>
UserName*: <input type='text' name='username' maxlength="50" /></br>
Password*: <input type='password' name='password' maxlength="50" /></br>
<input type='submit' name='submit' value='Submit' />
</form>

for more info about mkdir please read http://php.net/manual/en/function.mkdir.php