Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    Regular Coder
    Join Date
    Oct 2002
    Location
    Milwaukee, Wisconsin
    Posts
    123
    Thanks
    1
    Thanked 0 Times in 0 Posts

    arh anyone know how to use the or fnction??? asap please

    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

  • #2
    Regular Coder
    Join Date
    Feb 2003
    Location
    California
    Posts
    925
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #3
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    To be correct || is an operator not a function. And Jason is correct the || operator there is not being used correctly.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #4
    Regular Coder
    Join Date
    Oct 2002
    Location
    Milwaukee, Wisconsin
    Posts
    123
    Thanks
    1
    Thanked 0 Times in 0 Posts
    yup that works thanx man

  • #5
    Regular Coder
    Join Date
    Feb 2003
    Location
    East Side/West Side
    Posts
    118
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #6
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    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
    Enclosing that expression in quotes would cause PHP to evaluate it as a string.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #7
    Regular Coder
    Join Date
    Feb 2003
    Location
    East Side/West Side
    Posts
    118
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ...right

  • #8
    Regular Coder
    Join Date
    Oct 2002
    Location
    Milwaukee, Wisconsin
    Posts
    123
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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

  • #9
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    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.p...threadid=16954

    Do not also discuss in this thread.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #10
    Regular Coder
    Join Date
    Oct 2002
    Location
    Milwaukee, Wisconsin
    Posts
    123
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •