<?php
include "conn.inc.php";
?>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-2" />
<meta name="Keywords" content="" />
<meta name="Description" content=" " />
<title>IMGAY - Rejestracja</title>
</head>
<body>
<?php
if (isset($_POST['submit']) && $_POST['submit'] == "Zarejestruj") { if ($_POST['login'] != "" &&
$_POST['haslo'] != "" &&
$_POST['haslo_2'] != "" &&
$_POST['email'] !== "" ) {
$query = "SELECT login, haslo FROM uzytkownicy WHERE login = '".$_POST['login']."' AND haslo = '".$_POST['haslo']."'";
?>
<font color="#FF0000"><b>Nazwa użytkownika
<?php echo $_POST['login']; ?>jest już używana. Proszę wybrać inną</b></font>
<form action="rejestracja.php" method="post">
Login <input type="text" name="login" size="30" maxlength="40">
Hasło <input type="password" name="haslo" size="30" maxlength="40">
Powtórz hasło <input type="password" name="haslo_2" size="30" maxlength="40" >
Email <input type="text" name="email" size="30" maxlength="40" ></p>
<input type="checkbox" name="regulamin" value="tak" > Akceptuję <a href="regulamin.php">regulamin</a>
<?php $today = date("Y-m-d"); ?> <input type="submit" name="submit" value="Zarejestruj" >
<input type="reset" value="Wyczyść">
</form>
<?php
} else {
$query = "INSERT INTO `uzytkownicy` (login, haslo, haslo_2, email, today)
VALUES (
'".$_POST['login']."',
'".$_POST['haslo']."',
'".$_POST['haslo_2']."',
'".$_POST['email']."',
);";
{
}
else
{
}
$_SESSION['user_logged'] = $_POST['login'];
$_SESSION['user_password'] = $_POST['haslo'];
?>
Dziękujemy,
<?php echo $_POST['login'] . " " . $_POST['region']; ?> , za zarejestrowanie się!<br>
<?php
header("Refresh: 5: URL=index.php"); echo "Zakonczono proces rejestracji! " . "Zostaniesz przeniesiony do oryginalnej strony!<br>";
echo "(Jesli przegladarka nie obsluguje przekierowan, " . "<a href=\"index.php\">kliknij tutaj</a>)";
}
} else {
?>
Proszę wypełnić wszystkie pola
<form action="rejestracja.php" method="post">
Login <input type="text" name="login" size="30" maxlength="40">
Hasło <input type="password" name="haslo" size="30" maxlength="40">
Powtórz hasło <input type="password" name="haslo_2" size="30" maxlength="40" >
Email <input type="text" name="email" size="30" maxlength="40" ></p>
<input type="checkbox" name="regulamin" value="tak" > Akceptuję <a href="regulamin.php">regulamin</a>
<?php $today = date("Y-m-d"); ?> <input type="submit" name="submit" value="Zarejestruj" >
<input type="reset" value="Wyczyść">
</form>
<?php
}
} else {
?>
<form action="rejestracja.php" method="post">
Witamy na stronie rejestracji</p>
Login <input type="text" name="login" size="30" maxlength="40">
Hasło <input type="password" name="haslo" size="30" maxlength="40">
Powtórz hasło <input type="password" name="haslo_2" size="30" maxlength="40" >
Email <input type="text" name="email" size="30" maxlength="40" ></p>
<input type="checkbox" name="regulamin" value="tak" > Akceptuję <a href="regulamin.php">regulamin</a>
<?php $today = date("Y-m-d"); ?> <input type="submit" name="submit" value="Zarejestruj" >
<input type="reset" value="Wyczyść">
</form>
<?php
}
?>
</body>
</html>