Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $polaczenie = mysql_connect('localhost', 'studentw_ustaw', 'Zo7GNa9521');
- if (!$polaczenie) {
- die('Błąd połączenia: ' . mysql_error());
- } else {
- echo '<p class="error">Połączenie niby działa! </p>';
- }
- if (isset($_POST['submit'])) {
- $username = mysqli_real_escape_string($polaczenie, trim($_POST['username']));
- $password = mysqli_real_escape_string($polaczenie, trim($_POST['password']));
- $password2 = mysqli_real_escape_string($polaczenie, trim($_POST['password2']));
- echo '<p class="error"> Przed ifem z warunkami </p>';
- if (!empty($username)) {
- echo ' Jest username';
- }
- if (!empty($password)) {
- echo 'Jest haslo';
- }
- if (!empty($password2)) {
- echo 'Jest drugie haslo ';
- }
- if (($password == $password2)) {
- echo 'Hasła są te same';
- }
- }
- mysqli_close($polaczenie);
- ?>
- <p> Wpisz nazwę i hasło, aby zarejestrować się na naszej stronie</p>
- <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
- <fieldset>
- <legend> Dane do rejestracji</legend>
- <label for="username">Nazwa użytwkownika:</label>
- <input type="text" id="username" name="username" value="<?php if (!empty($username)) echo $username; ?>"/> <br />
- <label for="password">Hasło:</label>
- <input type="password" id="password" name="password"/> <br />
- <label for="password2">Powtórz hasło:</label>
- <input type="password" id="password2" name="password2"/> <br />
- </fieldset>
- <input type="submit" value="Zarejestruj się" name="submit"/>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement