Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <?php
- function AddMe()
- {
- ?>
- <form name = "new user" action = "" method = "POST" />
- Desired Username :
- <br />
- <input type = "text" name = "username" />
- <br />
- Password :
- <br />
- <input type = "text" name = "password1" />
- <br />
- retype password:
- <br />
- <input type = "text" name = "password2" />
- <br />
- <input type = "submit" value = "Add Me!" />
- </form>
- <?php
- }
- if(!isset($_POST['username']) && !isset($_POST['password1']) && !isset($_POST['password2']))
- {
- AddMe();
- }
- elseif($_POST['password1'] != $_POST['password2'])
- {
- $flag = 'false';
- AddMe();
- echo '<br />';
- echo 'The two passwords did not match!';
- }
- elseif(isset($_POST['username']) && isset($_POST['password1']) && isset($_POST['password2']))
- {
- $U_Name = "\r\n" . $_POST['username'];
- $Pass = "\r\n" . md5($_POST['password1']);
- $users = fopen('C:/wamp/db/users.txt', 'a+');
- $Pwords = fopen('C:/wamp/db/Pwords.txt', 'a+');
- fwrite($users, $U_Name);
- fwrite($Pwords, $Pass);
- fclose($users);
- fclose($Pwords);
- $Clean_U_Name = htmlentities($_POST['username']);
- echo 'Thank You ' , $Clean_U_Name , ' you can now <a href = "login.php">sign in</a>';
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement