Jump to content


Photo

If statement problem


  • Please log in to reply
2 replies to this topic

#1 holowugz

holowugz
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 06 September 2006 - 11:56 PM

Hi i am having a slight problem with an if statement i need it to do the following:
if the value of do in the request superglobal array is set to alter, and the person usergroup id is 6 OR their is a 6 in there membergroupids then execute some code.

$_REQUEST['do']= "alter";
$citac->userinfo['membergroupids'] = "1,2,3,4,5,6";


if($_REQUEST['do'] == 'alter' AND ($citac->userinfo['usergroupid'] == 6 OR in_array(6,array($citac->userinfo['membergroupids'])))){
echo "test";
}

theoretically that should echo test but it doesnt, can anyone see something wrong?

thanks in advance,
Luke

#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,023 posts

Posted 07 September 2006 - 12:14 AM

try

$citac->userinfo['membergroupids'] = array(1,2,3,4,5,6);
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#3 holowugz

holowugz
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 07 September 2006 - 12:26 AM

Hi ty for the help, it is early in the morning over here so i am not thinking lol. ty again




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users