Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(-1);
- $check = mysqli_query($conn,"SELECT * FROM korisnici WHERE username ='".$username."'");
- $usercheck = mysqli_num_rows($check);
- if($usercheck != 0)
- {
- if (isset($_POST["btnreg"]))
- {
- if(strlen($username) > 25 || strlen($username) < 3)
- {
- $error[] = "Username limit 25";
- }
- if(strlen($password)>64||strlen($password)<8)
- {
- $error[] = "PASS limit 25";
- }
- if($password != $repassword)
- {
- $error[] = "pass don match";
- }
- if($email != $reemail)
- {
- $error[] = "email dont match";
- }
- if (empty($error))
- {
- $d = 'INSERT INTO korisnici (username, password, email, maincategory, subcategory) VALUES ("'.$username.'", "'.$password.'", "'.$email.'", "'.$maincategories.'", "'.$subcategories.'")';
- $query = mysqli_query($conn, $d);
- if ($query)
- {
- echo "Registration sucessfully.";
- }
- else
- {
- echo "There was a problem registering user.";
- }
- }
- }
- }
- // test
- foreach ($error as $key)
- {
- echo "ERROR: " . $key;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement