...

View Full Version : arh anyone know how to use the or fnction??? asap please



stoodder
03-24-2003, 09:57 PM
well im working on my news script iand i notice that any type of user can post news ahen i have if($authrows[1] == (ADMIN||NEWS)) { php stuff here }

could someone please help me maybe need to use a variety but im not familiar with varieties

Jason
03-24-2003, 10:03 PM
I have never seen the or function used that way...try breaking it up into two parts....
if($authrows[1] == ADMIN||$authrows[1] == NEWS)) { php stuff here }

if your problem is the OR function then there is the answer, but Im not so sure thats where the problem is, and then again, I can't see all the code either.


Jason

Spookster
03-24-2003, 10:49 PM
To be correct || is an operator not a function. And Jason is correct the || operator there is not being used correctly.

stoodder
03-25-2003, 01:41 AM
yup that works thanx man

Phantom
03-25-2003, 01:50 AM
Just for the record, what you previously had (in a logical form) made it so

if $auth_rows[1] == (ADMIN || NEWS)

The value of $auth_rows[1] would have to be "(ADMIN||NEWS)" for it to work :p :)

Spookster
03-25-2003, 02:21 AM
Originally posted by Phantom
Just for the record, what you previously had (in a logical form) made it so

if $auth_rows[1] == (ADMIN || NEWS)

The value of $auth_rows[1] would have to be "(ADMIN||NEWS)" for it to work :p :)

Enclosing that expression in quotes would cause PHP to evaluate it as a string.

Phantom
03-25-2003, 02:40 AM
...right

stoodder
03-25-2003, 04:42 AM
lol yep i figured that out when everything failed and that worked.. got another well not problem more of a rquest on my hands but how oculd i make like atlly thig.. its for my news reply system i just added on to my news system, say the reply database is newsreply and the row "reply" specifies which replie it is to.. in this case it is numbers for a better examle http://www.shadowgelert.com

lol i dont want to pos my code i know i got alot wrong so m scared peeps will critque it to much lol but if you really need it ill give it to ya

Spookster
03-25-2003, 05:28 AM
Originally posted by stoodder
lol yep i figured that out when everything failed and that worked.. got another well not problem more of a rquest on my hands but how oculd i make like atlly thig.. its for my news reply system i just added on to my news system, say the reply database is newsreply and the row "reply" specifies which replie it is to.. in this case it is numbers for a better examle http://www.shadowgelert.com

lol i dont want to pos my code i know i got alot wrong so m scared peeps will critque it to much lol but if you really need it ill give it to ya

You already have another thread started for that here:

http://codingforums.com/showthread.php?s=&threadid=16954

Do not also discuss in this thread.

stoodder
03-25-2003, 05:32 AM
yup thats my fault sorry about that I'll work on it... I'll see if i can lock this post. tanx sppoksetr for noting me on that im learning lol.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum