在用户注册/加入后创建用户目录(0777)

How to create a user directory upon the user registering/joining. mkdir() is what would be used to create the directory but where in the .php code would I insert it. Here is a link to the .php code: http://tinyurl.com/qjuxty8 I know it would go after the:

else if($_POST['submit']=='Register')

This confirms that the user is in fact registering not signing it. The user input data is then ran through some statements making sure the user is inputting the correct length etc. . . and then the data is scrubed and cleaned for SQL Injection and what not. Here is an example of what you will see in the code.

$_POST['email'] = mysql_real_escape_string($_POST['email']);
$_POST['usr'] = mysql_real_escape_string($_POST['usr']);
$_POST['firstN'] = mysql_real_escape_string($_POST['firstN']);
$_POST['lastN'] = mysql_real_escape_string($_POST['lastN']);
$_POST['country'] = mysql_real_escape_string($_POST['country']);
$_POST['state'] = mysql_real_escape_string($_POST['state']);
$_POST['city'] = mysql_real_escape_string($_POST['city']);
$_POST['jobtitle'] = mysql_real_escape_string($_POST['jobtitle']);
$_POST['website'] = mysql_real_escape_string($_POST['website']);

Could someone please give me an idea on where this mkdir() needs to be inserted and any other useful information that could help, Thank You!

I would put it in the following block:

if(mysql_affected_rows($link)==1)
{ 

    //I WOULD PUT IT RIGHT HERE
    $makeDir = mkdir("YOUR DIRECTORY NAME HERE");
    if(!$makeDir)
    {
       //DO SOMETHING IF THE DIRECTORY FAILED TO BE CREATED
    }

    send_mail(  'admin@.com',
                $_POST['email'],
                'Registration .com - Your New PassCode',
                'Congratulations! You are now a memeber of  and can start to share your views. You can login at the homepage, top-right with this passcode: '.$pass);

    $_SESSION['msg']['reg-success']='You will recieve your PassCode via E-mail, approx... 5 to 10 minutes!';

}

This is the idea location because it is in the registration block and because the registration information was insert into the database successfully.

You'll have to decide what you want to name the directory for each user--maybe something based off of $_POST['usr']. You'll also want to put some code in the if block I created in case the directory fails to be created for some reason.

Hope that helps.

bool mkdir ( string $pathname [, int $mode = 0777 [, bool $recursive = false [, resource $context ]]] );

The return value lets you know if the directory was made correctly.