Chce aby użytkownik nie mógł stworzyć konta o loginie który jest w bazie ani żeby nie mógł zostawić pustych pól jednak coś źle poszło i nici z tego ;/
<?php
include('cfg.php');
if($_POST['creat'] == 1 )
{
if(!empty($_POST["login"]) && !empty($_POST["password"])){ echo "Uzupelnij wszystkie pola";} else{
{
$query = ('INSERT INTO user (id, login, pw, email)
VALUES ('', ''.$post_login.'', ''.$post_password.'', ''.$post_meail.'')') or
die(mysql_error());
}
}
}
else {
<link rel='Stylesheet' type='text/css' href='style.css'>
<form action='register.php' method=POST>
<input class='input' type='text' name='login' maxlength='12'> - Nazwa użytkownika <br /> <br />
<input class='input' type='password' name='password' maxlength='8'> - Haslo <br /> <br />
<input class='input' type='text' name='email'> - Adres email <br /> <br />
<input class='input' type='submit' value='Rejestruj'>
<input type='hidden' name='creat' value='1'>
</form>
";
}
?>