Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default password checker

    hi,
    I have a little problem with the following part of my code.
    I use post method to get the password from the form [$first ].
    Because there is an encrypted password in mysql database, I check with
    $pass = mysql_query("Select password('$unencryptedPass')");
    while($row = mysql_fetch_array($unencryptedPass))
    {

    $encryptedPassw = $row[0];
    }
    how the encrypted password looks like.
    Then I make a simple query:
    mysql_query("Select login, password from edv_verantwortliche where
    login = '$login' AND password = '$encryptedPassw'") or
    die("authorization failed");
    But it doesn' t seem to work. I could login every time.

    I have checked all values with echo method - they are correct...
    Could somebody help me, please.

    TIA
    magda muskala Guest

  2. Similar Questions and Discussions

    1. Grammar Checker
      Is there a grammar checker extension for dreamweaver?
    2. Accessibility Checker
      What is the purpose of the Accessibility Checker? Is it a definitive assessment of a document's accessibility? Do you advise people to use it as a...
    3. MySQL PHP Password Checker
      Can anyone please lend me a hand, I'm trying to design a cookie based password system. I have managed to do everything bar one thing that is...
    4. os checker
      Does anyone know of good code to check what browser and os people have, basically i need to load in one css file if people are on pc and another if...
  3. #2

    Default Re: password checker


    On 5-Oct-2003, [email]euv01657@student.euv-frankfurt-o.de[/email] (magda muskala) wrote:
    > hi,
    > I have a little problem with the following part of my code.
    > I use post method to get the password from the form [$first ].
    > Because there is an encrypted password in mysql database, I check with
    > $pass = mysql_query("Select password('$unencryptedPass')");
    > while($row = mysql_fetch_array($unencryptedPass))
    > {
    >
    > $encryptedPassw = $row[0];
    > }
    > how the encrypted password looks like.
    > Then I make a simple query:
    > mysql_query("Select login, password from edv_verantwortliche where
    > login = '$login' AND password = '$encryptedPassw'") or
    > die("authorization failed");
    > But it doesn' t seem to work. I could login every time.
    >
    > I have checked all values with echo method - they are correct...
    > Could somebody help me, please.
    You will only die if mysql encounters an error. Not finding any rows is not
    an error. Also, you can do it all in one SELECT.

    try:

    $rs = mysql_query("select login,password from edv_verantwortliche where
    login=$login and password=password('$unencryptedPass')") or die('mysql
    error: ',mysql_error());
    if (mysql_numrows($rs)==0)
    {
    echo 'Authorization Failed.';
    exit();
    }
    // authorization OK
    }

    --
    Tom Thackrey
    [url]www.creative-light.com[/url]
    tom (at) creative (dash) light (dot) com
    do NOT send email to [email]jamesbutler@willglen.net[/email] (it's reserved for spammers)
    Tom Thackrey Guest

  4. #3

    Default Password Checker

    Let me start by saying I am not an avid coder. I know Dreamweaver inside and
    out and have used a lot of it's built in Database connectivity tools and always
    get a lot of use from extensions. I am in search for and extension or add-on
    which will check a user ID and Password. If the login is 'X' then you are
    directed to a certain page. If the login is 'Y' you are directed elsewhere.
    And so on, using an access database. I need to create about 3 or 4 different
    groups. Any help is appreciated. Thanks

    Eric8000 Guest

  5. #4

    Default Password Checker

    Let me start by saying I am not an avid coder. I know Dreamweaver inside and
    out and have used a lot of it's built in Database connectivity tools and always
    get a lot of use from extensions. I am in search for and extension or add-on
    which will check a user ID and Password. If the login is 'X' then you are
    directed to a certain page. If the login is 'Y' you are directed elsewhere.
    And so on, using an access database. I need to create about 3 or 4 different
    groups. Any help is appreciated. Thanks

    Eric8000 Guest

  6. #5

    Default Re: Password Checker

    you don't need an extension for that, just add some vars and if's or
    switch staments in the DW login behavior. specify your server model and
    surely somebody will be able to help you

    manuel

    Eric8000 wrote:
    > Let me start by saying I am not an avid coder. I know Dreamweaver inside and
    > out and have used a lot of it's built in Database connectivity tools and always
    > get a lot of use from extensions. I am in search for and extension or add-on
    > which will check a user ID and Password. If the login is 'X' then you are
    > directed to a certain page. If the login is 'Y' you are directed elsewhere.
    > And so on, using an access database. I need to create about 3 or 4 different
    > groups. Any help is appreciated. Thanks
    >
    Manuel Socarras Guest

  7. #6

    Default Re: Password Checker

    Have you tried the Dreamweaver Server Behaviors for User Authentication?

    Brendan


    Singularity.co.uk Guest

  8. #7

    Default Re: Password Checker

    Hello. The behavior you are looking for is included in the server behavior set
    that DW provides by default. Once you set up a basic form for the username and
    password to be typed, go into the Server Behaviors panel and click the plus (+)
    sign. One of the listings there will be User Authentication and will give you
    several options that should get you started. I wasn't much of a coder either,
    but something that helped me make that leap was a book by the people at
    Webassist.com. Their Web Application Recipes book has some terrific
    tutorial/recipe chapters that take you through a half-plugin/half-coding
    workflow. User login is one of their recipes, but they also take you through
    building all of the other pages that might be handy once you have users logging
    in; namely user management, edit user data, lost my password, and even user
    access level, so that you could have more than one authentication tier for the
    content on your sites. Good stuff! HTH Bill

    Billium99 Guest

  9. #8

    Default Re: Password Checker

    you might decide that you don't want to base the names of the pages your user
    groups are sent to IN YOUR CODE.. You may want to make that a field in your
    user group table. then if you change where different user groups go, you don't
    have to modify your code.. just change the links in your database (the links
    would probably relative to the site root )... values for the startpagename
    field in usergroups might include .\admin\mainmenu.asp .\normal\mainmenu.asp
    ..\managers\mainmenu.asp then just check the group that user should go to...
    select nvl('.\login\loginpage.asp', usergroup.startpagename) as theirfirstpage
    from usergroups full join users on usergroup.id=users.usergroup_id where
    username=myLoginUser and userpassword=myPassword and redirect them to the page
    having the name of the sql field theirfirstpage the null value check (if their
    name and password didn't match) would take them back to the login page. And,
    you have other work to do. Other authentication behaviors dreamweaver will
    write for you may be needed ALL of your pages to make sure the user is logged
    in dreamweaver will write it for you too.. basically it does something like
    if (Session{'username')=NULL) redirect('LOGIN.ASPX') of course, the
    dreamweaver version is extra complex looking since it does some fancy error
    checking. the code for this should be imbedded in each page (but the login) to
    make sure they didn't link inside your passworded site without loggin in. rm

    RichMcCrea Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139