Guest User

Untitled

a guest
Oct 13th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. <?php
  2.  
  3. if(isset($_POST['submit_btn']))
  4. {
  5. $username = $_POST['name'];
  6. $password = $_POST['pwd'];
  7. $text = $username . "," . $password . "\n";
  8. $fp = fopen('accounts.txt', 'a+');
  9.  
  10. if(fwrite($fp, $text)) {
  11. echo 'saved';
  12.  
  13. }
  14. fclose ($fp);
  15. }
  16.  
  17. <form action = "" method="POST">
  18. <h1> Please enter your information to create a new login account</h1>
  19. <p>
  20. <label>Login Name:</label><input type = "text" name = "name" />
  21. <label>Password:</label><input type = "password" name = "pwd" />
  22. <br/>
  23. <br/>
  24. </p>
  25. <input type = "submit" name="submit_btn" id = "submit" value = "submit"/>
  26. <input type = "reset" id = "reset" value = "reset"/>
  27. </form>
Add Comment
Please, Sign In to add comment