daily pastebin goal
33%
SHARE
TWEET

Untitled

a guest Jul 20th, 2017 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. if($_SERVER['REQUEST_METHOD'] == 'POST') {
  3.   $directorie = './'; //You can change this to ../, or ./users/, just make sure it ends with a slash
  4.  
  5.   $fp = fopen($_POST['username'] .".txt", "w") or die("Can not create file"); //Create's the file
  6.   fwrite($fp, "Username = ". $_POST['username'] . PHP_EOL ."Password = ". $_POST['password']); //Write's to file
  7.   fclose($fp); //Close connection to file
  8.   echo 'Done!'; //Display this when they click submit
  9. } else {
  10.   echo '<form method="post">';
  11.   echo 'Username: <input type="text" name="username" /><br />';
  12.   echo 'Password: <input type="password" name="password" /><br />
  13.   <input type="submit" value="Submit" />';
  14.   echo '</form>';
  15. }
  16. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top