Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST["odeslat"])){
- require "./fce.php";
- $username = $_POST["username"];
- $pw = "/\A".$_POST["heslo"]."\z/";
- $pw2 = $_POST["heslo2"];
- $strFile = file_get_contents("login.txt");
- if(check($strFile, $username, ""))
- echo "Uživatel již existuje!<br />\n";
- else{
- if(preg_match($pw, $pw2)==0){
- echo "Hesla nejsou stejná!<br />\n";
- }else{
- file_put_contents("login.txt", $username.":".$pw2."\n", FILE_APPEND);
- }
- }
- }
- ?>
- <form action='reg.php' method='POST'>
- <table>
- <tr><td>Uživatelské jméno:</td><td><input type='text' name='username' /></td></tr>
- <tr><td>Heslo:</td><td><input type='password' name='heslo' /></td></tr>
- <tr><td>Heslo znovu:</td><td><input type='password' name='heslo2' /></td></tr>
- </table>
- <input type='submit' name='odeslat' value='odeslat' />
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement