06-29-2012, 03:46
(This post was last modified: 06-29-2012, 03:48 by ScHmIdTy56789.)
Hello,
So im making myself a login system for my site. and im having trouble with access_levels/permissions.
So this is what i have in my database so far (including my password):
Now when I get the row this is what I use:
And this is where I use my permissions:
But when I use it, It does not show the music tab. If i do:
It shows the tab for everyone. Is there anything that is wrong with my code? or am i using the database wrong?
Thanks,
ScHmIdTy56789
So im making myself a login system for my site. and im having trouble with access_levels/permissions.
So this is what i have in my database so far (including my password):
Now when I get the row this is what I use:
Code:
$q = mysql_query("SELECT access_level FROM members WHERE usr = '$username' AND pass = '".md5($_POST['password'])."'");
if(mysql_num_rows($q) > 0)
{
$alvl = mysql_fetch_row($q);
$alvl = $alvl[0];
}
And this is where I use my permissions:
Code:
<? If($alvl >= 4 ) { ?>
<div class="musicstub"> Music <br>
</div>
<script>
$(document).ready(function() {
$('.musicstub').stop().toggle(function(){
$(this).animate({width: 250, height: 50}, "fast");
},function() {
$(this).animate({width: 100, height: 15}, "fast");
});
});
</script>
<?}?>
Code:
If($alvl = 5 )
{
//code here
}
Thanks,
ScHmIdTy56789