#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Location
    Kouvola, Finland
    Posts
    11
    Rep Power
    0
    Hi! anybody got a sample PHP-script of user autherization, the login script or could help me with it?

    I really preciate your help! thanks already.




    ------------------
    -Aarno Villa
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 1999
    Location
    UK
    Posts
    50
    Rep Power
    15
    Its a bit of a mess but I hope it helps. It authenticates against a database I think, its been a while since I looked at authorisation stuff. You may need to change a few bits and pieces.

    if(!isset($PHP_AUTH_USER)) {
    Header("WWW-authenticate: basic realm="$SID"");
    Header("HTTP/1.0 401 Unauthorized");
    $title="Login Instructions";
    echo "<blockquote> n".
    "You are not authorised to enter the siten".
    "</blockquote> n";
    exit;
    } else {
    if ( $SID != "" )
    $SID="@".ereg_replace("@","",$SID);
    if (!($conn=ora_logon("$PHP_AUTH_USER$SID",$PHP_AUTH_PW))) {
    //if (!($conn=ora_logon("$PHP_AUTH_USER",$PHP_AUTH_PW))) {
    Header("WWW-authenticate: basic realm="$SID"");
    Header("HTTP/1.0 401 Unauthorized");
    $title="Login Instructions";
    echo "<blockquote> n".
    "You are not authorised to enter the siten".
    "</blockquote> n";
    exit;
    }
    }


    Falcon
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Location
    Kouvola, Finland
    Posts
    11
    Rep Power
    0
    Thanks Man! that helped much

    I got another problem too, I have a filemanager made with PHP3 and it just doesn´t work right, maybe you could check it and try to fix (or someone else, maybe) it,
    I would appreciate that because I need it for my project, If you or someone else is interested of fixing it, I can mail it.
    let me know then

    Thanks already!
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Location
    Kouvola, Finland
    Posts
    11
    Rep Power
    0
    it would be fine if the script verifies the password against some password-file, because i can´t use databses such as Mysql

    any solutions?


  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 1999
    Posts
    15
    Rep Power
    0
    hehe I have a filemanager too ..
    but it's missing some copy and move funktions
    I don't know a way to get the directory
    structure(on the fly) of my site =)
    so now its hidden deep in the basement
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Location
    Kouvola, Finland
    Posts
    11
    Rep Power
    0
    this is from ClipScripts, made by lacey pevey, and it just doesn´t work, file functions like Edit, Move and others,hopely somebody fixes it. I need that for one of my projects.

  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 1999
    Posts
    15
    Rep Power
    0
    I fixed mine .. by using find.
    If you are on a unix-box that
    does not run php in safe_mode
    it will work .. almost http://firewall.n3.net/download/efman099.zip
  14. #8
  15. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Location
    Kouvola, Finland
    Posts
    11
    Rep Power
    0
    oki, but that download doesn´t work maybe somebody delete that efman.zip before I downloaded it, damn. btw, how can I do a redirection after the user authetication, Header ("location: $url" ); doesn´t work, because it says that header is already set.
    any other ways to redirect it?
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 1999
    Location
    UK
    Posts
    50
    Rep Power
    15
    Code:
    <?PHP
    Authorisation Header
    ?>

    <html>
    <head>
    <title></title>

    <?PHP
    if ($something) {
    echo "<meta http-equiv=refresh content=0; url=url_1.htm>";
    } else {
    echo "<meta http-equiv=refresh content=0; url=url_2.htm>";
    ?>

    </head>
    <body>
    </body>
    </html>

    I think this is right, I hope it helps.

    Falcon

Similar Threads

  1. PHP math problem
    By spank in forum PHP Development
    Replies: 2
    Last Post: February 11th, 2004, 06:58 AM
  2. PHP User restrictions
    By Mastah in forum PHP Development
    Replies: 2
    Last Post: February 9th, 2004, 02:41 AM
  3. PHP link opening problem
    By Real World in forum PHP Development
    Replies: 2
    Last Post: February 5th, 2004, 06:48 AM
  4. XML DOM and PHP Problem, not displaying wanted info
    By drazhargraig in forum PHP Development
    Replies: 2
    Last Post: February 3rd, 2004, 03:14 PM
  5. fread problem: doesn t compile php code
    By ghorghor2002 in forum PHP Development
    Replies: 2
    Last Post: February 3rd, 2004, 05:25 AM

IMN logo majestic logo threadwatch logo seochat tools logo