furn355 Posted August 6, 2009 Posted August 6, 2009 I want a certain aspects of a mod im working on to be only available to users ID 1 and 2 I tried if($_GET['activate'] && $userid == 1&2) But it just removes the options completely for user id 1. i know if($_GET['activate'] && $userid == 1) works but i would like it so id 2 can see said aspects aswell. ANy help is much appreciated Quote
PHP Scene Posted August 6, 2009 Posted August 6, 2009 Re: id 1 and 2 Something like this? : $user_ids = array(1, 2); // the ids if(in_array($userid, $user_ids) && $_GET['activate']){ // code here } Quote
BoGFx Posted August 6, 2009 Posted August 6, 2009 Re: id 1 and 2 Isn't there a way to do 1 or 2? Quote
CraigF Posted August 6, 2009 Posted August 6, 2009 Re: id 1 and 2 Yeahh if($_GET['activate'] && $userid == 1 || $_GET['activate'] && $userid == 2) { } should work, the || means "or" Quote
Magictallguy Posted August 7, 2009 Posted August 7, 2009 Re: id 1 and 2 You could also use if($_GET['activate'] && $userid == 1 || 2) { //Run code } Quote
grimreaper6996 Posted August 8, 2009 Posted August 8, 2009 Re: id 1 and 2 This is what i use in my game and it works if($ir['userid'] != 1 && $ir['userid'] != 2 { print "type in here what you want people to see if they are not id 1 or 2 Quote
Cod Phoenix Posted August 8, 2009 Posted August 8, 2009 Re: id 1 and 2 This is what i use in my game and it works if($ir['userid'] != 1 && $ir['userid'] != 2 { print "type in here what you want people to see if they are not id 1 or 2 I think its wrong because != means equal to and not equal to so everyone can see it. Try MTG code his always work Quote
POG1 Posted August 8, 2009 Posted August 8, 2009 Re: id 1 and 2 PHP Scenes code will be the best 1 to use :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.