Hesap oluşturun
		
		
		
		        
        if (@$_GET["passwordconfirm"] == "no") {
            
            echo "
Girdiğiniz şifreler uyuşmamaktadır.
";
            
        } elseif (@$_GET["empty"] == "yes") {
            
            echo "
Boş bıraktığınız alanlar var.
";
            
        }
        
        ?> 
				
		
        
                
        if ($_POST) {
            
            $firstname          = $_POST["firstname"];
            $surname            = $_POST["surname"];
            $username           = $_POST["username"];
            $email              = $_POST["email"];
            $password           = md5($_POST["password"]);
            $password_confirm   = md5($_POST["password_confirm"]);
			$token 				=tokengenerator(50);
            
            if (empty($firstname) || empty($surname) || empty($username) || empty($email) || empty($password) || empty($password_confirm)) {
            
				header("location:register.php?empty=yes");
				
            } else {
                
                if ($password == $password_confirm) {
					
				if (isset($_POST["register"])) {
					$save=$con->prepare("INSERT INTO users SET
						firstname=:firstname,
						surname=:surname,
						username=:username,
						email=:email,
						password=:password,
						token=:token
						");
					$insert=$save->execute(array(
						'firstname' => $firstname,
						'surname' => $surname,
						'username' => $username,
						'email' => $email,
						'password' => $password,
						'token'=> $token
					));
				}
					
				$_SESSION["username"] = $username;
				$_SESSION["login"] = "1";
				header("location:index.php");
                } else {
				header("location:register.php?passwordconfirm=no");
					
                }
            }
        
        }
        
        ?>
tokengenerator kısmından ne geliyor bilmiorum ben orayı 123456 yaptım sorunsuz çalışıyor hocam, 
  if (empty($firstname) || empty($surname) || empty($username) || empty($email) || empty($password) || empty($password_confirm)) şu kısımda ufak bir denetleme hatanız vardı