Solved

If statement syntax question

Posted on 2013-01-27
4
248 Views
Last Modified: 2013-01-27
Hey guys,

I'm having a little trouble adding  more than 1 usergroup to this if statement. How could I alter this so that it I can select usergroup not equal to 1,2 and 5.

if (Phpfox::getUserBy('user_group_id') != 1)

Open in new window



Thank you!
0
Comment
Question by:TLN_CANADA
  • 2
  • 2
4 Comments
 
LVL 35

Accepted Solution

by:
Robert Schutt earned 500 total points
ID: 38824754
Try putting it in a variable:
$grp = Phpfox::getUserBy('user_group_id');
if ($grp != 1 && $grp != 2 && $grp != 5)

Open in new window

0
 

Author Comment

by:TLN_CANADA
ID: 38824826
Thank you very much Robert! Works perfectly.

No worries at all if you don't have the time but I'm really stuck with a javascript question and if you had some time to take a look at it that would be greatly appreciated.

http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28009982.html
0
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 38824886
sorry, I've seen that one, gave it a try but couldn't get it to work the way you want.
0
 

Author Comment

by:TLN_CANADA
ID: 38824888
no worries Robert, thanks for trying :)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Cpanel file manager 8 40
What does this formatting equate to? 7 18
Number of reviews not counting correctly 2 22
Ajax php search with multiple text fields generated by php 38 65
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question