所以我有一個代碼註冊,我想爲每個用戶註冊,他得到自己的文件夾與他註冊的同名,我不知道該怎麼做,我聽到有mkdir但即時通訊新的,所以如果任何人都可以幫助我,請在哪裏我應該添加該mkdir或什麼和命令是什麼!註冊後登錄的目錄
這裏是我的register.php:
<?php
require_once 'core/init.php';
if(input::exists()) {
if(Token::check(Input::get('token'))) {
$validate = new Validate();
$validation = $validate->check($_POST, array(
'username' => array(
'required' => true,
'min' => 2,
'max' => 20,
'unique' => 'users'
),
'password' => array(
'required' => true,
'min' => 6
),
'password_again' => array(
'required' => true,
'matches' => 'password'
),
'name' => array(
'required' => true,
'min' => 2,
'max' => 50
)
));
if($validation->passed()) {
$user = new User();
$salt = Hash::salt(32);
try {
$user->create(array(
'username' => Input::get('username'),
'password' => Hash::make(Input::get('password'), $salt),
'salt' => $salt,
'name' => Input::get('name'),
'joined' => date('Y-m-d H:i:s'),
'group' => 1
));
Session::flash('home', '<h3>Registracija uspešna!</h3>');
Redirect::to('mojprofil.php');
} catch (Exception $e) {
die($e->getMessage());
}
} else {
foreach($validation->errors() as $error) {
echo $error, '<br>';
}
}
}
}
?>
http://php.net/ mkdir我的建議是你在同一點創建目錄,你的'$ user-> create()**是成功的**。 – Aquillo