Skip to main content
Participating Frequently
November 14, 2007
Question

Custom pages depending on password

  • November 14, 2007
  • 15 replies
  • 992 views
Hi, I've created a webpage in php for my girlfriend who's a photographer and she wants a client page where they will enter a password and it will lead them to a page based on the password. I was wondering if anyone knows of a tutorial or a way for me to do just that.

any help is appreciated
This topic has been closed for replies.

15 replies

Participant
December 4, 2007
Thanks David, this is very helpful and give me a direction to work on.
Inspiring
December 4, 2007
ryonker wrote:
> how can I redirect them to a specific section based
> on their access level? For instance, admins would only go to the admin section,
> client 1 would only go the client one section and client 2 would only go to the
> client 2 section. I hope that I am making sense.

The built-in Dreamweaver Log In User server behavior doesn't have the
option the direct users to specific pages, although you can use the
technique I outlined earlier in this thread for Andy-K to direct
individuals to their own page or folder by using $_SESSION[MM_Username].

The Log In User server behavior creates two session variables:
$_SESSION['MM_Username'] (the username) and $_SESSION['MM_UserGroup']
(the access level). It's up to you to use PHP logic to control what is
displayed on the page displayed after login. In simple terms:

if ($_SESSION['MM_UserGroup'] == 'admin') {
// show admin menu
}
else {
// show non-admin menu
}

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Participant
December 4, 2007
I actually have a similar problem where the user will log in and based on their level in the user DB they should be directed to a specific page for their level. I have a mySQL DB with a users table and an access level field. When the user logs in their username, password and access level are validated with the users table. My question is how can I redirect them to a specific section based on their access level? For instance, admins would only go to the admin section, client 1 would only go the client one section and client 2 would only go to the client 2 section. I hope that I am making sense.
Andy-KAuthor
Participating Frequently
December 2, 2007
I've got another question regarding this. It seems that whenever I log in for the first time I get an error that says the page cannot be found, however when I go back and log in again it works flawlessly, this is happening on both firefox and ie.

Any ideas?

Thanks
Andy-KAuthor
Participating Frequently
November 25, 2007
Thanks for all your time.

you were right, I removed the quotes and it fixed it, and there was also some code missing for a random image script that I have on there.

Thanks again
Inspiring
November 24, 2007
Andy-K wrote:
> this is the actual error i get
>
> Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting
> T_STRING or T_VARIABLE or T_NUM_STRING in
> /home/danausel/public_html/pages/clients3.php on line 47

That's caused by putting quotes around MM_Username.

> i tried putting in ../clients/$_SESSION[MM_Username]/index.php

That should work. It sounds as though there is something else wrong with
the code. Which version of Dreamweaver are you using? There's a bug in
the Log In User server behavior in MX 2004. If you're using MX 2004, see
this thread in the friends of ED forum:

http://friendsofed.infopop.net/2/OpenTopic?a=tpc&s=989094322&f=8033053165&m=324102421

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Andy-KAuthor
Participating Frequently
November 23, 2007
this is the actual error i get

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/danausel/public_html/pages/clients3.php on line 47

i tried putting in ../clients/$_SESSION[MM_Username]/index.php

and also $_SESSION['MM_Username']

and using echo as well but nothing seemed to work

thanks for any further advice you may give me
Inspiring
November 23, 2007
Andy-K wrote:
> i got another question, i tried putting the session variable into the "if login
> succeeds, go to" but i keep getting errors and it doesn't seem to work,

It's virtually impossible to answer such a vague question. What do the
error messages say? Try to describe what happens when it doesn't work.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Andy-KAuthor
Participating Frequently
November 23, 2007
i got another question, i tried putting the session variable into the "if login succeeds, go to" but i keep getting errors and it doesn't seem to work, is there a special way that i need to put them in?

thanks
Andy-KAuthor
Participating Frequently
November 14, 2007
thanks for all your help, I'll make sure to check those books out

Thanks again, have to go try it out now :)