Results 1 to 4 of 4

Thread: Dumb Question

  1. #1
    Join Date
    Sep 2007
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Dumb Question

    Hello everyone, I have a pretty easy (I think) question. I've done my homework, but I can't seem to find why the following code won't work:

    PHP Code:
    if (!$_POST["pass"]==="password")
        {
        die(
    "Wrong Password or Security Code");
        } 
    I tried echoing the POST above and it worked fine.

    If it makes any difference, it's right below a reCaptcha confirmation and above all HTML tags.

    Thanks,
    Connor

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    Please describe what you're trying to do.

    You might want:

    if ($_POST["pass"] != "password"){ die("Wrong Password or Security Code"); }

    or

    if (!$_POST["pass"]){ die("Wrong Password or Security Code"); }

    or something completely different. let us know.

  3. #3
    Join Date
    Sep 2007
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ah, that first one seems to work, thanks! I was doing it the C# way of putting the ! before the statement. It never occurred to me to check that.

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    In php I believe that reverses the variable then computes. Using != or parentheses around the part to be inverted should work fine.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

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