Anmeldung klappt nicht

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

  • Anmeldung klappt nicht

    Hallo zusammen! Ich habe mir ein Script heruntergeladen und installiert, alles funktioniert reibungslos, nur leider komm ich nicht in den Admin Bereich!

    Folgende Datei regelt den Login, ich habe in SQL via phpmyadmin einen usernamen und ein passwort eingetragen, nur wird es nicht akzeptiert!

    Kann mir bitte jemand helfen und mal den Code durchschaun, wo da ein Fehler ist, oder ich etwas vergessen habe zu modifizieren?
    Danke schon mal im Voraus!
    Grüße Roland
    PHP-Code:

    <?
    /////////////////////////////
    #############################
    #       phProfession        #
    # The Resume Posting Script #
    # Source by Mykel Nahorniak #
    #############################
    /////////////////////////////

    /*
    This is the authentication code for 
    the administration section of phProfession.
    To add a user, go into MySQL, and type:

        INSERT into admin VALUES(
        '',
        'username',
        'password'
        );
    */

    ##################
    # Authentication #
    ##################

    if (!isset ($PHP_AUTH_USER)) {
            Header ("WWW-Authenticate: Basic realm=\"Administration\"");
            Header ("HTTP/1.0 401 Unauthorized");
            echo ("Login incorrect. Names and passwords are case sensitive.");
            exit;
    } else {
            $user = $PHP_AUTH_USER;
            $password = $PHP_AUTH_PW;
            $query = "select * from admin where username = '$user' and password = '$password'";
            $result = mysql_db_query("jobs", $query);

            if (mysql_num_rows ($result) != 1) {
                    Header ("WWW-Authenticate: Basic realm=\"phProfession Administration\"");
                    Header ("HTTP/1.0 401 Unauthorized");
                    echo ("Login incorrect. Names and passwords are case sensitive.");
                    exit;
            }
    }

    ?>
    Zuletzt geändert von ToyonGraphics; 10.08.2004, 13:15.

  • #2
    [PHP]-Tags benutzen!

    Kommentar


    • #3
      Wahrscheinlich ein register_globals Problem.
      Versuchs mal mit $_SERVER['PHP_AUTH_...'].

      Kommentar


      • #4
        Original geschrieben von TobiaZ
        [PHP]-Tags benutzen!
        @ToyonGraphics
        das heisst aber nicht, dass du noch einmal den code postest. d.h. dass du deinen ersten post entsprechend änderst. den neuen post habe ich mal sicherheitshalber entfernt!
        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


        • #5
          Hi!

          nein, das wars nicht, habs mal so umgändert und es hat nichts gebracht, nicht mal ne Fehlermeldung *gg*

          PHP-Code:
          <?
          /////////////////////////////
          #############################
          # phProfession #
          # The Resume Posting Script #
          # Source by Mykel Nahorniak #
          #############################
          /////////////////////////////

          /*
          This is the authentication code for 
          the administration section of phProfession.
          To add a user, go into MySQL, and type:

          INSERT into admin VALUES(
          '',
          'username',
          'password'
          );
          */

          ##################
          # Authentication #
          ##################

          if (!isset ($_SERVER['PHP_AUTH_USER'])) {
          Header ("WWW-Authenticate: Basic realm=\"Administration\"");
          Header ("HTTP/1.0 401 Unauthorized");
          echo ("Login incorrect. Names and passwords are case sensitive.");
          exit;
          } else {
          $user = $_SERVER['PHP_AUTH_USER'];
          $password = $_SERVER['PHP_AUTH_PW'];
          $query = "select * from admin where username = '$user' and password = '$password'";
          $result = mysql_db_query("jobs", $query);

          if (mysql_num_rows ($result) != 1) {
          Header ("WWW-Authenticate: Basic realm=\"phProfession Administration\"");
          Header ("HTTP/1.0 401 Unauthorized");
          echo ("Login incorrect. Names and passwords are case sensitive.");
          exit;
          }
          }

          ?>

          Kommentar


          • #6
            Sorry @Abraxax!! War keine Absicht, habs jetzt kapiert!
            :-)

            Kommentar


            • #7
              als was läuft dein PHP? als CGI oder als Modul?
              PHP_AUTH_... funz nur mit PHP als Modul, vielleicht liegts dran

              Kommentar


              • #8
                wie bekomme ich das raus wie es läuft und wenn es daran liegt, gibst ne Möglichkeit wie ich das skritp dann ändern kann, dass es läuft?
                Danke im Voraus Grüße
                Roland

                Kommentar


                • #9
                  am einfachstens über phpinfo(), sonst httpd.conf

                  Kommentar


                  • #10
                    ok, also wenn
                    Server API CGI
                    heisst, dass es als CGI läuft, dann hab ich Pech, oder kann mans umformulieren, damit es dennoch läuft! wäre spitze, da es das einzige script ist, das genau das erfüllt, wonach ich suche!

                    Kommentar


                    • #11
                      Jepp, was für Webserver hast du Apache, IIS, ...?
                      Andererseits du kannst auch ein stink normales Formular dem User anbieten.

                      Hast das hier schon mal gelesen? http://de.php.net/features.http-auth

                      Kommentar


                      • #12
                        Falls Du das meinst, hab ich das:
                        SERVER_SOFTWARE Apache/df-exts 1.1 (Unix) mod_ssl/2.8.19 OpenSSL/0.9.6k AuthPG/1.3 FrontPage/5.0.2.2510

                        Danke für den Link, aber das sind mehr als spanische Dörfer für mich...
                        Dachte eher an eine Umformulierung anstatt einer Umprogrammierung...

                        Kommentar


                        • #13
                          Original geschrieben von ToyonGraphics
                          Sorry @Abraxax!! War keine Absicht, habs jetzt kapiert!
                          :-)
                          und warum änderst du es dann immer noch nicht?
                          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


                          • #14
                            Also,
                            habs auf einen Server geschmissen, der PHP als Modul läd ...
                            jetzt kommt leider folgende Fehlermeldung:

                            Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/web99/html/jobs/auth.php on line 37

                            Warning: Cannot modify header information - headers already sent by (output started at /var/www/web99/html/jobs/auth.php:37) in /var/www/web99/html/jobs/auth.php on line 38

                            Warning: Cannot modify header information - headers already sent by (output started at /var/www/web99/html/jobs/auth.php:37) in /var/www/web99/html/jobs/auth.php on line 39

                            Login incorrect. Names and passwords are case sensitive.
                            Die Zeilen die er Anspricht sind folgende (ab 37)
                            PHP-Code:
                                    if (mysql_num_rows ($result) != 1) {
                                            
                            Header ("WWW-Authenticate: Basic realm=\"phProfession Administration\"");
                                            
                            Header ("HTTP/1.0 401 Unauthorized");
                                            echo (
                            "Login incorrect. Names and passwords are case sensitive.");
                                            exit; 
                            Danke im Voraus und Grüße
                            Roland



                            Zuletzt geändert von ToyonGraphics; 11.08.2004, 13:15.

                            Kommentar


                            • #15
                              Original geschrieben von ToyonGraphics
                              jetzt komtm leider folgende Fehlermeldung:
                              hurra, also funktioniert jetzt alles.


                              ...?
                              I don't believe in rebirth. Actually, I never did in my whole lives.

                              Kommentar

                              Lädt...
                              X