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

restricitng access to a page using PHP

Guest
Oct 30, 2007 Oct 30, 2007

Copy link to clipboard

Copied

I need to restrict access to a display page that displays DB results from a contact page. The site is on a shared Win hosting plan with the global session variables turned off. I have a login page that works fine, but when I try to implement a "restrict access " server behavior on the display page, the login page just re-directs to the login page. I did research the problem and it appears the global session variables that are set on the login page are not passing, because they are not turned on at the server. So, I need a workaround. If some one could point me in the right direction, I would be grateful. almost done with this site, need to get it done. I can post code if anyone is interested but, it's just the standard server behavior in DW. I know it's cheating but I needed a quick fix, I did hand code my own contact page and the display page. Thanks.
TOPICS
Server side applications

Views

498
Translate

Report

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

correct answers 1 Correct answer

LEGEND , Oct 30, 2007 Oct 30, 2007
steevo2 wrote:
> //declare two session variables and assign them
> $GLOBALS['MM_Username'] = $loginUsername;
> $GLOBALS['MM_UserGroup'] = $loginStrGroup;
>
> //register the session variables
> session_register("MM_Username");
> session_register("MM_UserGroup");

You're using an old version of Dreamweaver. Either update your version
of Dreamweaver or use the hand-coding fix that I posted in the friends
of ED forum three-and-a-half years ago:

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

Votes

Translate
LEGEND ,
Oct 30, 2007 Oct 30, 2007

Copy link to clipboard

Copied

steevo2 wrote:
> //declare two session variables and assign them
> $GLOBALS['MM_Username'] = $loginUsername;
> $GLOBALS['MM_UserGroup'] = $loginStrGroup;
>
> //register the session variables
> session_register("MM_Username");
> session_register("MM_UserGroup");

You're using an old version of Dreamweaver. Either update your version
of Dreamweaver or use the hand-coding fix that I posted in the friends
of ED forum three-and-a-half years ago:

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/

Votes

Translate

Report

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
Community Beginner ,
Oct 30, 2007 Oct 30, 2007

Copy link to clipboard

Copied

assign the session variables to a variable.

b4 leaving the login page, try

$access=$_SESSION['MM_Username']

another thing that has worked with me is refering to the variable as:

$MM_Username, but i'm not sure that will work everywhere

Votes

Translate

Report

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
Guest
Oct 30, 2007 Oct 30, 2007

Copy link to clipboard

Copied

Thanks David,

Coded up those changes, it worked well. Thanks! Yes I do have to upgrade DW, but need some money first. Plan on getting CS3 basic web package. And, continue to hone my PHP skills so I can at least recognize when I am using deprecated code. One of the pitfalls of using DW scripts I guess, but I can tell you , this one I will remember. : )
On to the crypt function. Cheers.!

Votes

Translate

Report

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
Guest
Oct 30, 2007 Oct 30, 2007

Copy link to clipboard

Copied

Vamp, Thank you as well!

Votes

Translate

Report

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 ,
Oct 30, 2007 Oct 30, 2007

Copy link to clipboard

Copied

steevo2 wrote:
> Thanks David, Is that fix just for the login page or is there a code change to the restrict access script as well.?

I no longer have MX 2004 installed, so I can't remember, but I'm fairly
confident that I didn't post just a half-solution. Make the changes
outlined in that post, and test your site. You'll soon see whether it works.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

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 ,
Oct 30, 2007 Oct 30, 2007

Copy link to clipboard

Copied

steevo2 wrote:
> Vamp, Thank you as well!

Unfortunately, the Vampmaster's suggestions won'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/

Votes

Translate

Report

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
Guest
Oct 31, 2007 Oct 31, 2007

Copy link to clipboard

Copied

LATEST
Oops, should have made that a new post instead of editing the thank you post above, but in case you didn't see it David :

quote:

Thanks David,
Coded up those changes, it worked well. Thanks! Yes I do have to upgrade DW, but need some money first. Plan on getting CS3 basic web package. And, continue to hone my PHP skills so I can at least recognize when I am using deprecated code. One of the pitfalls of using DW scripts I guess, but I can tell you , this one I will remember. : )
On to the crypt function. Cheers.!


Also , I had posted that last question b4 I got home and tried your fix, my apologies. Thanks again!


Votes

Translate

Report

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