Skip to main content
Participant
June 19, 2007
Question

DW8 Restricting Access using PHP

  • June 19, 2007
  • 1 reply
  • 302 views
I'm sure there is a simple explanation for what is happening, but I have no idea what that would be. I have set up one site with an admin section and had some problems with restricting access to the pages, but somehow I got it to work (that was several months ago). I'm having a similar issue with a new site that has a very similar admin section. If I try to log in to the index.php page which has been restricted it kicks me over to the login page, I login in and then I can see the index.php page. But if I try to access a page one more level down, it won't let me and just keeps returning me to the loginfailed page. I'm using the same web hosting company so I don't think that's the problem. It acts as though it's not connecting to the database, but I checked the connections and they seem to be working fine. Any suggestions would be appreciated. By the way, I'm using PHP and MySQL and the username and password are stored in a database. I'm only trying to restrict the pages by username and password.
This topic has been closed for replies.

1 reply

Inspiring
June 21, 2007
you might check to see if session_start(); is on your restricted pages as php needs this to keep the sesion alive
boulderspAuthor
Participant
June 21, 2007
Thank you for the advice and I double checked and the pages do have session_start(); I'm putting the code in via the Server Behaviors --> User Authentication --> Restrict Access to Page. It works on the pages that are at the same level as the login page and one level below that. However, if I go in another level then it won't work. I'm not sure if that has anything to do with it, but it's a pattern.