ohje schon wieder authenticate :/

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • ohje schon wieder authenticate :/

    halli hallo ...
    ich wollt mal ein super simples skript machen für eine zugegeben unsichere abfrage, aber für diesen zweck sollt´s das tun ...

    erhalte immer folgende fehlermeldung....
    Parse error: parse error in
    c:\inetpub\apacheroot\autcheck.php on line 21


    ahja, is apache unter windows :/ hoffe es liegt nich wieder an dem ...

    grüsse nuggi




    PHP-Code:
    <?
    // definierte namen fürs login
    $NAME_REQUIRED = "test" ;
    $PW_REQUIRED = "t1";

    function authenticate() {
        Header("WWW-authenticate: basic realm=\"BC\"");
        Header("HTTP:/1.0 401 Unauthorized");
        echo "Keine Berechtigung";
    }

    // usercheck
    if (!isset($PHP_AUTH_USER))
    authtenticate();

    else
    {
        if (($NAME_REQUIRED == $PHP_AUTH_USER) && 
        (($PW_REQUIRED == PHP_AUTH_PW))
        
        echo "Hallo $PHP_AUTH_USER";
        else authenticate();
    }
    ?>

  • #2
    hier ist eine klammer zuviel....

    PHP-Code:
    // dein code
    if (($NAME_REQUIRED == $PHP_AUTH_USER) && 
    ((
    $PW_REQUIRED == PHP_AUTH_PW))

    // mal in einer zeile
    if (($NAME_REQUIRED == $PHP_AUTH_USER) && (($PW_REQUIRED == PHP_AUTH_PW))

    // und nun richtig ... :-)
    if (($NAME_REQUIRED == $PHP_AUTH_USER) && ($PW_REQUIRED == PHP_AUTH_PW)) 
    INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


    Kommentar


    • #3
      leute, ist es eigentlich zu viel verlangt, dass ihr euch bei einem simplen parse error euren code erstmal selber in ruhe anseht...?
      I don't believe in rebirth. Actually, I never did in my whole lives.

      Kommentar

      Lädt...
      X