Jump to content

function not evaluating correctly


rofl90

Recommended Posts

Heres my function, it always returns 0...

 

function user_type($page) {
$user = $logged_user;
$level = mysql_query("SELECT * FROM users WHERE user='$user'");
$level_a = mysql_fetch_array($level);
$final_level = $level_a['usergroup'];
$check_level = mysql_query("SELECT * FROM userstructure WHERE name='$final_level'");
$check_level_a = mysql_fetch_array($check_level);
if ( $check_level_a[''.$page.''] == '1' ) {
	return "1";
} else {
	return "0";
}
}

 

Heres how I use it in a backend page: ex. testimonials:

 

if(user_type("testimonials") == "0") {
header("Location: notallowed.php");
exit();
}

Link to comment
https://forums.phpfreaks.com/topic/98085-function-not-evaluating-correctly/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.