Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Custom pages depending on password

New Here ,
Nov 13, 2007 Nov 13, 2007
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
TOPICS
Server side applications
968
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Nov 13, 2007 Nov 13, 2007
Whats going to be on the page? DW has built in user authentication behaviors, if you want to learn to use the tool, then go to a Bookstore, there are lots of books for learning PHP with Dreamweaver, look at a few and buy one you will be glad, $30-40 can save a lot of time.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 13, 2007 Nov 13, 2007
all thats going to be on the page are the client's photos but i just want the client that will be issued a password to be able to view his/her own pictures using that password
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 13, 2007 Nov 13, 2007
also to add, i have a login page where when a certain password is entered, it will take them to their own page to view their photos
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 14, 2007 Nov 14, 2007
"Andy-K" wrote
> 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
>

Maybe you can use this great site
http://www.zubrag.com/scripts/password-protect.php

/Tine


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 14, 2007 Nov 14, 2007
Andy-K wrote:
> also to add, i have a login page where when a certain password is entered, it will take them to their own page to view their photos

Use the built-in Dreamweaver Log In User server behavior on the login
page. Create a folder for each user based on the username. So, if the
username is joesoap, create a folder called either joesoap or
joesoap_photos. You can then use this to redirect the user to his/her
own folder on successful login.

In the Log In User server behavior dialog box, enter the following in
the field labelled "If login succeeds, go to":

$_SESSION[MM_Username]/index.php

This will take the user called joesoap to joesoap/index.php. If you call
the folder joesoap_photos, us this:

$_SESSION[MM_Username]_photos/index.php

Apply the Restrict Access to Page server behavior to all restricted pages.

Someone else suggested getting a book on PHP and Dreamweaver. If you're
looking for one, take a look at my "The Essential Guide to Dreamweaver
CS3 with CSS, Ajax, and PHP" (you can see more details by following the
link in my sig). It covers all the server behaviors in Dreamweaver, as
well as teaching you the basics of PHP so that you can adapt the
Dreamweaver code to suit your own requirements.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 14, 2007 Nov 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 🙂
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 22, 2007 Nov 22, 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 23, 2007 Nov 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/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 23, 2007 Nov 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 24, 2007 Nov 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/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 25, 2007 Nov 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 02, 2007 Dec 02, 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 03, 2007 Dec 03, 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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 04, 2007 Dec 04, 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/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 04, 2007 Dec 04, 2007
LATEST
Thanks David, this is very helpful and give me a direction to work on.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines