Creation of user folder now works!

This commit is contained in:
Filip Nilsen 2021-01-25 08:50:02 +01:00
parent 43799c45a3
commit 1000a9f38a
11 changed files with 7 additions and 44 deletions

View File

@ -28,14 +28,14 @@ $username = test_input($_POST["username"]);
$pattern = "/[^a-zA-z0-9_\-]/"; //remove any character that is not: a-z A-Z _ - $pattern = "/[^a-zA-z0-9_\-]/"; //remove any character that is not: a-z A-Z _ -
$username = preg_replace($pattern, "", $username); $username = preg_replace($pattern, "", $username);
if (strlen($usename) < 2) { if (strlen($username) < 2) {
return; return;
} }
//there needs to be a way to check if username is allready taken //there needs to be a way to check if username is allready taken
$base_dir = "./../.."; $base_dir = "./../..";
$user_dir = $base_dir . "/user/" . username; $user_dir = $base_dir . "/user/" . $username;
echo user_dir; echo user_dir;
mkdir($user_dir); mkdir($user_dir);
?> ?>

View File

@ -6,11 +6,11 @@
<?php $script = "../etc/cgi/register.php"; //script location <?php $script = "../etc/cgi/register.php"; //script location
?> ?>
<form action="<?php echo $script; ?>" method="post"> <form action="<?php echo $script; ?>" method="post">
User name: <input type="text" id="username" required><br> User name: <input type="text" name="username" required><br>
Full name: <input type="text" id="full_name"><br> Full name: <input type="text" name="full_name"><br>
Email: <input type="text" id="email"><br> Email: <input type="text" name="email"><br>
Password: <input type="password" id="password" required><br> Password: <input type="password" name="password" required><br>
Verify password: <input type="password" id="password2" required><br> Verify password: <input type="password" name="password2" required><br>
<input type="submit"> <input type="submit">
</form> </form>
</body></html> </body></html>

View File

@ -1,5 +0,0 @@
<!DOCTYPE html>
<html>
<body>
<h1>Administrate</h1>
</body></html>

View File

@ -1,7 +0,0 @@
<!DOCTYPE html>
<html>
<body>
<h1>Log in or create new user</h1><br>
<a href="login.php">Log in</a>
<a href="register.php">Register new User</a>
</body></html>

View File

@ -1,11 +0,0 @@
<!DOCTYPE html>
<html>
<body>
<h1>Register new user</h1>
<p>You might want to review the source code of fBoard before you register</p>
<form action="../cgi/register.php">
<input type="text" id="user_name" required>
<input type="password" id="password" required>
<input type="password" id="verify_password" required>
</form>
</body></html>

View File

@ -1,6 +0,0 @@
<!DOCTYPE html>
<html>
<body>
<h1>fBoard</h1>
</body>
</html>

View File

@ -1,8 +0,0 @@
<!DOCTYPE html>
<html>
<body>
<?php
include "includes/header.php";
?>
</body>
</html>