28, May 2012

directory problem with User access class - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: directory problem with User access class
« previous next »
Pages: [1] Print

Author Topic: directory problem with User access class  (Read 1741 times)
World Wide Whale
***
Gender: Female
Posts: 154
1052 credits
Members referred : 0



« on: Dec 14, 2006, 05:48:10 pm »

O.K. I got the script working beautifully, doing everything I want/need it to do.  The only problem is that if you are not logged in and you hit a password protected page, you go to my 404 error page instead of my login page. 

I would prefer, instead of it taking you to the login page, like it is trying to do, to take you to a, "You must be logged in to have access to this page" message, or page.  Because I am getting ready to put a login form on my index page. 

I would post code or something here, but I am not even sure what would be needed. 

Thanks,
Newbie
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: Dec 14, 2006, 07:47:32 pm »

hi,

Quote
O.K. I got the script working beautifully, doing everything I want/need it to do.  The only problem is that if you are not logged in and you hit a password protected page, you go to my 404 error page instead of my login page.

the path is wrong!

Quote
I would prefer, instead of it taking you to the login page, like it is trying to do, to take you to a, "You must be logged in to have access to this page" message, or page.  Because I am getting ready to put a login form on my index page.

I would post code or something here, but I am not even sure what would be needed. 

Its up to you to put this text on your login page

World Wide Whale
***
Gender: Female
Posts: 154
1052 credits
Members referred : 0



« Reply #2 on: Dec 14, 2006, 07:53:45 pm »

But where is it wrong?  Where should I change the path?  The links work if you are logged in, just not if you are not logged in.  So, I know I have screwed up somewhere, I'm just not sure why.
Thanks
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: Dec 14, 2006, 09:31:52 pm »

check the url where you get the 404 and verify the setting in the config file

World Wide Whale
***
Gender: Female
Posts: 154
1052 credits
Members referred : 0



« Reply #4 on: Dec 14, 2006, 09:57:15 pm »

Code:
<?php 
// use this pathes and/or define the pathes for the "standard" pages
define("CLASS_PATH"dirname($_SERVER['PHP_SELF'])."/"); // the location where the class is executed
$sec_path "/WebFolder/TestLoginPhp/classes/access_user/"// a second location where the scripts should be 
define("APPLICATION_PATH"$sec_path);

// modify these constants to fit your environment
define("DB_SERVER""blahblah");
define("DB_NAME""blahblah");
define ("DB_USER""blahblah");
define ("DB_PASSWORD""blahblah");

// Important! use this setting to store the session data in your Mysql database
// disable this feature if your host doesn't support this session handler.
define("USE_MYSQL_SESSIONS"true); // "false" to disable thios setting

// these are the names for the standard table names
// !!! Important
// It's possible that your server doesn't allTeow the database name inside a query
// if this forms a problem don't use them here and unescape the mysql_select_db() function
// inside the connect_db() method.
define("USER_TABLE"DB_NAME.".users"); 
define("PROFILE_TABLE"DB_NAME.".users_profile");
define("COUNTRY_TABLE"DB_NAME.".countries"); // an optional table with countruy names and codes
define("SESSION_TABLE"DB_NAME.".sessions"); 

// variables (locations) standard pages (combine the pathes from the top or use your own)
define("LOGIN_PAGE"CLASS_PATH."login.php");
define("START_PAGE""/blahblahblah/index.htm");
define("ACTIVE_PASS_PAGE"APPLICATION_PATH."activate_password.php");
define("DENY_ACCESS_PAGE"APPLICATION_PATH."deny_access.php");
define("ADMIN_PAGE"APPLICATION_PATH."admin_user.php");
define("LOGOUT_PAGE"APPLICATION_PATH."logout.php"); // if you use the setting "USE_MYSQL_SESSIONS" you need a logout page without class object to clear the old session data from the database

// your path must be related to the site root.
 
// change this constants to the right mail settings
define("WEBMASTER_MAIL""blahblah"); 
define("WEBMASTER_NAME""blahblah"); 
define("ADMIN_MAIL""blahblah"); 
define("ADMIN_NAME""blahblah"); 

// change this vars if you need...
define("PW_LENGTH"4);
define("LOGIN_LENGTH"6);

define("COOKIE_NAME""user"); 
define("COOKIE_PATH"APPLICATION_PATH);
define("MIN_ACCESS_LEVEL"1);
define("MAX_ACCESS_LEVEL"10);
define("DEFAULT_ACCESS_LEVEL"1);
define("DEFAULT_ADMIN_LEVEL"10);

//////////////////////////////////////////////////
// constants and field names user profile table //
/////////////////////////////////////////////// //
// stamdard fields are: address, postcode, city, country, phone, fax, homepage, textfield
// variables must match your user profile table design
// use this four user defined fields (type varchar(100) too
// change the value of a constant but change them in the mysql table too
// otherwise you wil get some ERROR'S !!!
define("TBL_USERFIELD_1""user_1");
define("TBL_USERFIELD_2""user_2");
define("TBL_USERFIELD_3""user_3");
define("TBL_USERFIELD_4""user_4");
define("TBL_USERFIELD_5""user_5");
define("TBL_USERFIELD_6""user_6");
?>
OK, I checked it & i still can't figure out what it is.  I filled in the personal information with "blahblah", that of course is not what is in the actual code. 

I want to apologize.  I have taught myself, HTML, CSS, & JavaScript.  I am trying to learn PHP.  I can't say I feel very confident with it.  I really appreciate all of your help, my next PHP project will be to make it a CSS switcher, not really looking forward to that.....

Thanks again....
« Last Edit: Jun 07, 2007, 05:05:02 pm by PHPNewbie-KY »
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #5 on: Dec 15, 2006, 08:00:07 am »

do you have this script on some website? what is the URL?

World Wide Whale
***
Gender: Female
Posts: 154
1052 credits
Members referred : 0



« Reply #6 on: Dec 15, 2006, 02:54:58 pm »

Yes, it is on an active website.  Is there any way to send you the URL without posting it here?
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #7 on: Dec 15, 2006, 04:01:36 pm »

Yes, it is on an active website.  Is there any way to send you the URL without posting it here?
do you have a local php enableds host? how do you test it?

Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #8 on: Dec 15, 2006, 04:02:20 pm »

Yes, it is on an active website.  Is there any way to send you the URL without posting it here?
do you have a local php enableds host? how do you test it?

I don't understand it the first moment, send the URL via the PM system

Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #9 on: Dec 16, 2006, 12:01:31 am »

just tried to access your update profile page without login and I got the login page not a 404 page maybe you can test this on a different computer?

World Wide Whale
***
Gender: Female
Posts: 154
1052 credits
Members referred : 0



« Reply #10 on: Dec 16, 2006, 12:05:55 am »

It's the bio, blog, video, photo and link pages. 
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #11 on: Dec 16, 2006, 12:27:50 am »

I think this is not good:

define("LOGIN_PAGE", CLASS_PATH."login.php");
check the path you get from the 404 page and the real location from you login page

World Wide Whale
***
Gender: Female
Posts: 154
1052 credits
Members referred : 0



« Reply #12 on: Dec 16, 2006, 12:50:04 am »

Thanks so much!!  That fixed it!!
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=5227
Tags : Accress Class Directory Error Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: directory problem with User access class
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 07:04:30 pm





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.