Login in a forum

Im having trouble creating a login for a forum im working on. Nothing happens when I click on the login button. Below is the code I have used. Btw Im very new in php, i have just started learning it…

$user_id = $_GET['users']; ?>

	$brugernavn = $_POST['brugernavn'];
	$password = $_POST['password'];
	$sqlBruger = "SELECT * FROM users WHERE user_name = '$brugernavn' AND user_pswd = '$password'";
	$getBruger = mysql_query($sqlBruger) or die (mysql_error());
	$bruger = mysql_fetch_assoc($getBruger);
	if(mysql_num_rows($getBruger)== 1){
		$bruger_role = $bruger['fk_role_id'];
		$_SESSION['functions'] = array ();
		$sql = "SELECT * 
				FROM functions
				INNER JOIN roles
				ON roles.role_id = role_functions.fk_role_id	
				INNER JOIN role_functions
				ON role_functions.fk_func_id = functions.function_id	
				INNER JOIN users
				ON users.fk_role_id = roles.role_id
				WHERE users.user_id = '$user_id' 
				GROUP BY functions.function_id
		$result = mysql_query($sql) or die (mysql_error());
		while($row = mysql_fetch_assoc($result)){
			$_SESSION['functions'][] = $row['function_id'];
		$_SESSION['logInd'] = true;
			echo '<p>FORKERT LOGIN!...<br />
			Brugernavn er password er ikke rigtigt udfyldt!...</p><br /><br />';
			echo 'Prøv igen:';
			echo '<a href="index.php?">Tilbage til Forside</a>';

Try removing $user_id = $_GET[‘users’]; at the top of your page. If that doesn’t work, please post your form


Sorry for the late rply and thanx for taking your time to help. I had trouble logging in… Anyway, I decided to start afresh (building a forum)…hopefully I will figure it out :slight_smile: Thanx again