...

View Full Version : Question - $_SESSION



Jon W
03-04-2008, 08:44 AM
Hello!

I was wondering if you guys could help me out with something. If I wanted to check if a users level was either level 1 or 2 to do something on my website would I have to make two if statements or could I just simply do this:




<?php

if($_SESSION['level'] == 1, 2) {

// allow this action to happen

}
else
{

// Nothing happens.

}

?>


Thank for the help guys!

Jon W

abduraooft
03-04-2008, 08:51 AM
if(in_array($_SESSION['level'],array(1,2))) or simlpy

if($_SESSION['level']==1 || $_SESSION['level'] ==2)

Jon W
03-04-2008, 09:10 AM
Ok thanks.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum