Guest User

Untitled

a guest
Dec 11th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. if(isset($_POST['username'])) $username = $_POST['username'];
  2. if(isset($_POST['password'])) $password = $_POST['password'];
  3. if(isset($_POST['action'])) $action = $_POST['action'];
  4.  
  5. if(isset($action)) {
  6. switch($action) {
  7. case 'ADD':
  8. $file = 'testdata.txt';
  9. $file = fopen($file, 'a') or die('cant open file');
  10. fwrite($file, $username . ' ' . $password . chr(13));
  11. fclose($file);
  12. return '111';
  13. break;
  14.  
  15. default:
  16. echo '<p>' . $action . '</p>';
  17. echo '<p>' . $username . '</p>';
  18. echo '<p>' . $password . '</p>';
  19. break;
  20. }
  21. }
Add Comment
Please, Sign In to add comment