My goal :
I want to create Registration Form, when the registration is success so I direct to 'user profile -> index page'.
Directory :
Registration page in : myproject/account/create.php
User profile -> index page in : myproject/profile/nameuser/index.php
Step How it work :
1. Fill registration form
2. Submit form
3. If fail, fill again until success
4. When success, go to folder profile, then create a unique new folder for new user (it mean user folder), then create index page in user folder, then bring each user to access their each index page.
My problem :
I am trying to using method mkdir() in PHP but it can't solve because permission is denied
If any configuration in Linux to solve, I don't know what is the way
My Code :
if (empty($err)) {
if ($insert_stmt = $mysqli->prepare("INSERT INTO member (uname, mail, pwd) VALUES (?, ?, ?)")) {
$insert_stmt->bind_param('sss', $uname, $mail, $pwd);
if (! $insert_stmt->execute()) {
header('Location: ../error.php?err=Registration failure: INSERT');
}
}
$directory = "../profile/$uname";
if(!is_dir($directory)) {
mkdir("$directory");
touch('$directory/index.php');
}
header('Location: $directory . index.php');
}
Hope someone can help me to solve my problem.