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

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.


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

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. :frowning:

(I’m lost)

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.

So…

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

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/xxxxxxxxxxxxxxxxxxxxxx.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/xxxxxxxxxxxxxxxxxxxxxxxxx.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!

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.

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. :frowning:
Thanks.

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 :slight_smile: Good luck!

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.

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 :wink: