Maybe it is a simple question, but I'm looking for this for a while and I can't find it in any reference. How can I tell a php script to do nothing?

Example:

if user = someone do nothing
else log user in file

I hope I make sence.

Thanks

    I don't know if I got you meaning or not, because it seems too simple for this question:

    if($user != "someone") {
    ...... //log user in file
    }

    Just this...

      to pyfsapple:

      Is

      if($user != "someone") {
      ...... //log user in file
      }

      the same thing as:

      if user=peter do nothing
      else user=anyoneelse log user ???

        if($user != "someone") { 
        ...... //log user in file 
        } 
        

        ok, lets pseudocode this for you 😉

        IF user IS NOT EQUAL TO "someone" THEN
        Do stuff
        END IF
        CONTINUE SCRIPT

        It's doing exactly what you want, but opposite to what you're thinking. When it gets to that point in the script, it will run the stuff inside the if statement, if the user is NOT equal to your condition, otherwise it just skips all that stuff completely.

        Hope that helps 🙂

          Thanks, I got it.

          This is a bit different from the old BASIC that i was used to.

          You know: if t=1 then print t... :-)

          But I guess this is why this place is called Newbies.

          Thanks again.

            Write a Reply...