Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['submit']))
- {
- $username = $_POST['username'];
- if (file_exists($dirname)) {
- echo "Name already taken.";
- } else {
- mkdir($username, 0755);
- }
- fopen(".$username./.htaccess", "r+");
- $content = "AuthUserFile /.htpasswd\nAuthType Basic\n\nrequire user $username";
- file_put_contents(".$username./.htaccess",
- echo "Please <a href='$username'>click here</a> to login.";
- }
- ?>
- <!DOCTYPE HTML>
- <head>
- <meta charset="UTF-8">
- <title>Register</title>
- </head>
- <body>
- <form method="post" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>">
- Username: <input type="text" name="username"><br>
- Password: <input type="password" name="password"><br>
- <input type="submit" name="submit" value="submit">
- </body>
- </html>
Add Comment
Please, Sign In to add comment