Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if($_SERVER['REQUEST_METHOD'] == 'POST') {
- $directorie = './'; //You can change this to ../, or ./users/, just make sure it ends with a slash
- $fp = fopen($_POST['username'] .".txt", "w") or die("Can not create file"); //Create's the file
- fwrite($fp, "Username = ". $_POST['username'] . PHP_EOL ."Password = ". $_POST['password']); //Write's to file
- fclose($fp); //Close connection to file
- echo 'Done!'; //Display this when they click submit
- } else {
- echo '<form method="post">';
- echo 'Username: <input type="text" name="username" /><br />';
- echo 'Password: <input type="password" name="password" /><br />
- <input type="submit" value="Submit" />';
- echo '</form>';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement