SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Member
    Join Date
    May 2012
    Location
    Michigan
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Create Login that accepts two different passwords and links to two different places

    We have a website that now needs two different "Dealer Only" sections. We have had just one Dealer Section and access was through entering a single password supplied by us (not a login name) which was encrypted then linked to the Dealer Section.

    Now we want to have just one login "box" where you can enter one of two different login "words", with each word taking the user to a different "Dealer Section".

    I did originally have a prior page set up with two buttons (one for Distributors and one for Dealers), after selecting one of these choices the user was taken to a page for their login. Worked fine except that now I'm told that we don't want either the Distributors nor the Dealers to know that they have different "Dealer Sections".

    We do not want each user to create their own password etc. But would prefer for all Distributors have one password and all Dealers have another (both supplied by us).

    I'm new to this (obviously) and need all the help I can get.
    Thanks.

    For reference, this is the site (although I have just taken down the Dealer Login till this is sorted out)
    http://www.lakeshoreproducts.com

  2. #2
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,182
    Mentioned
    67 Post(s)
    Tagged
    2 Thread(s)
    I would help you except that your from Michigan...

    Lol. So what is the programming language that you are using? You'll just want an if statement in the login script.

    PHP Code:
    if ($password == 'this') {
    \\
    redirect to proper page
    } elseif ($password == 'that') {
    \\
    redirect to proper page
    } else {
    echo 
    'invalid pass yo';


  3. #3
    SitePoint Member
    Join Date
    May 2012
    Location
    Michigan
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, I didn't mention that I am using a simple Javascript with a Password Encryption. Didn't go the whole php/mySQL type thing because, having never used it before and while trying to sort it out, it seemed like it was much more than I needed since we would be giving the dealers the password to use (they wouldn't be creating a password and login of their own) I'm sure there is probably a way to do it but I don't really know anything about it. :-(

    (I'm lost)

  4. #4
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,182
    Mentioned
    67 Post(s)
    Tagged
    2 Thread(s)
    Java script is a client side language, thus is not secure at all for what you want to accomplish. Depending on how it is written, javascript could be disabled to prevent the showing of the pass prompt or your two passwords could even be viewed by simply right click the page to view the source code.

    A very quick and simple PHP script (no SQL) could be written to handle this.

  5. #5
    SitePoint Member
    Join Date
    May 2012
    Location
    Michigan
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So....

    I don't suppose you could just help a girl out and show me how to write the PHP script? :-)

    I want to click on the Dealer Log in link at the top right of the home page:
    http://www.lakeshoreproducts.com

    then have a login page
    (something simple looking like this : http://www.lakeshoreproducts.com/loginPage.html)

    When the user enters the word "xxxxxxxxxxxxxxxxxx" they would be taken to the first page of the Dealers Section : http://www.lakeshoreproducts.com/xxx...xxxxxxxxx.html

    When the user enters the word "xxxxxxxxxxxxxxxxxxx" (instead of "xxxxxxxxxxxxxxxxxxxx"), they would be taken to the first page of the Direct Dealers Section, instead : http://www.lakeshoreproducts.com/xxx...xxxxxxxxx.html


    I know it's asking a lot, but this is all greek to me and I feel that if someone would be so kind as to actually write out what I need AND (very important) tell me where it put it , along with any other code I would need to make it work, I just might start understanding what it's all about.

    I would be so very, very grateful.
    Cheers!
    Last edited by guido2004; Sep 13, 2012 at 07:37. Reason: deleted some stuff

  6. #6
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,182
    Mentioned
    67 Post(s)
    Tagged
    2 Thread(s)
    Just a heads up, anyone googling lakeshoreproducts.com will most likely come across this forum post since SP is highly ranked in Google. You may want to remove your production passwords from your post.

  7. #7
    SitePoint Member
    Join Date
    May 2012
    Location
    Michigan
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I had that thought just after I submitted the post. I don't know how to edit the post, so I guess I'm just going to have to use different passwords if I ever get this working. :-(
    Thanks.

  8. #8
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,182
    Mentioned
    67 Post(s)
    Tagged
    2 Thread(s)
    Looks like your good now. The code example I gave earlier is essentially what you are looking for. The action property of the log in form will link to "login.php" which contains something very similar to my example. It must check the password, set a session(), and then user header() to forward them on. Then on your admin pages, at the top of the page in PHP, ensure that session() is set to the correct value, or else use header() again to vacate them from the secure area.

    I know this might be a little vague but I'm unable to write any code at the moment. Some one esle may want to fill in the gaps, or better yet, this should provide a good learning experience for you if you manage to google through it yourself :-) Good luck!

  9. #9
    SitePoint Member
    Join Date
    May 2012
    Location
    Michigan
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a bunch.
    I had spent a few days weeks ago trying to immerse myself in php stuff, but since I didn't have any objective I was just floundering around. Maybe with this I can give it another go. (I've had to teach myself everything to do with web design so far with no one to talk to , so I'll keep at it) Thanks again.

  10. #10
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,509
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by monta17 View Post
    I've had to teach myself everything to do with web design so far with no one to talk to
    Don't hesitate to visit the forums to "talk" to someone (there are always people around) and ask your questions, after some thorough research by yourself of course


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
  •