Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- include "functions.php";
- ?>
- <head>
- <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
- <link rel="Stylesheet" type="text/css" href="style.css" />
- </head>
- <?php
- if (isset($_SESSION['logged_in']))
- {
- echo "<script type=\"text/javascript\">
- window.setTimeout(\"window.location.replace('login.php')\")
- </script>";
- }
- else
- {
- echo "<div id='register'>";
- echo "<h2>Formularz rejestracyjny</h2>";
- echo "<form id='register-form' action='$PHP_SELF' method='post'>";
- echo "<fieldset>";
- echo "<sup>*</sup>Nick: <input type='text' name='login'><br /><br />";
- echo "<sup>*</sup>Hasło: <input type='password' name='haslo'><br /><br />";
- echo "<sup>*</sup>Adres e-mail: <input type='text' name='mail'></fieldset><br /><br /><br />";
- echo "<center>Informacje dodatkowe</center><br /><br />";
- echo "<fieldset>";
- echo "Numer gadu-gadu: <input type='text' name='gg'><br /><br />";
- echo "Identyfikator skype: <input type='text' name='skype'><br /><br /><br />";
- echo "<b>Pola oznaczone gwiazdką są wymagane</b>";
- echo "</fieldset><br />";
- echo "<input type='reset' value='wyczyść' class='button'>";
- echo "<input type='submit' value='zarejestruj' name='register' class='button'>";
- echo "</form>";
- echo "</div>";
- }
- if (isset($_POST['register']))
- {
- if(!empty($_POST['login']) && !empty($_POST['haslo']))
- {
- if(!empty($_POST['mail']))
- {
- $login=$_POST['login'];
- $password=md5($_POST['haslo']);
- $mail=$_POST['mail'];
- $gg=$_POST['gg'];
- $skype=$_POST['skype'];
- }
- $reserved_l=mysql_query("select * FROM db_user WHERE username='$login'");
- $reserved_m=mysql_query("select * FROM db_user WHERE mail='$mail'");
- if(@mysql_num_rows($reserved_l))
- {
- echo "<center><big><b>Ta nazwa użytkownika jest już zajęta.</b></big></center>";
- }
- else
- if(@mysql_num_rows($reserved_m))
- {
- echo "<center><big><b>Ten adres e-mail jest już zajęty.</b></big></center>";
- }
- if(!@mysql_num_rows($reserved_l) && !@mysql_num_rows($reserved_m))
- {
- mysql_query("INSERT INTO db_user VALUES ('','$login','u','0','$password','$mail','$gg','$skype')") or die ("błąd".mysql_error());
- echo "<big><b><center>Twoje konto zostało utworzone  <br />Aby się zalogować kliknij<a href='login.php'>tutaj</a></big></b>";
- }
- }
- }
- else
- {
- echo "<br /><br /><big><b><center>Wypełnij wymagane pola<center></b></big>";
- }
- ?>
- //Rozkmiń o co tu chodzi i opisz :)
Add Comment
Please, Sign In to add comment