Jump to content
php.lv forumi

Reģistrācija


Blackout

Recommended Posts

Es nesaprotu kas te īsti nav pareizi?

vnk izmet: Логин успешно создан

 

a tālāk nekur

 

$username = $_POST['username'];
$email = $_POST['email'];
$realname = $_POST['realname'];
$password = $_POST['password'];
$confirm = $_POST['confirm'];
$sex = $_POST['sex'];
$city = $_POST['city'];
$valsts = $_POST['valsts'];
$kakuznal = $_POST['kakuznal'];
$bd = $_POST['bd'];
$ircnick = $_POST['ircnick'];
$icqnumber = $_POST['icqnumber'];
$website = $_POST['web'];
$games = $_POST['games'];
$intereses = $_POST['intereses'];
$aboutself = $_POST['aboutself'];
$level = 1;
$title = Пользователь;
$registered = date('G:i, d-m-Y');
$last_ip = GetHostByName($REMOTE_ADDR);

$user_query = mysql_query("SELECT * FROM user");
$num_users = mysql_num_rows( $user_query );

if ( $password == $confirm ) {


$user_query = mysql_query("SELECT * FROM user WHERE email='".$email."'");
$num_users_email = mysql_num_rows( $user_query );
if ( $num_users_email == 0 ) {

$user_query = mysql_query("SELECT * FROM user WHERE username='".$username."'");
$num_users_username = mysql_num_rows( $user_query );
if ( $num_users_username == 0 ) {
$user_query = mysql_query("INSERT INTO user VALUES( NULL, '".$username."', '".$email."' '".$realname."', '".$password."', '".$sex."', '".$city."', '".$valsts."', '".$kakuznal."', '".$bd."', '".$ircnick."', '".$icqnumber."', '".$website."', '".$games."', '".$intereses."', '".$aboutself."', '".$level."', '".$title."', '".$registered."', '".$last_ip."', '".$registered."')");

echo 'Логин успешно создан';
} else {
echo 'Логин занят';
}

} else {
echo("Почта уже занята.");
}

} else {
echo("Паролы не совподает.");
}

Link to comment
Share on other sites

kautkaads vaajpraat sarakstiits.

1.) neticu, ka ar slaavu burtiem ir nodefineeta konstatne

2.) paswordus plaintekstaa glabaat nav veseliigi

3.) manupraat gjiniaalas rindas -

$user_query = mysql_query("SELECT * FROM user");

$num_users = mysql_num_rows( $user_query );

Link to comment
Share on other sites

×
×
  • Create New...