22, November 2008

Please explain the directory structure for this class - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ 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: Please explain the directory structure for this class
« previous next »
Pages: [1] Print

Author Topic: Please explain the directory structure for this class  (Read 1292 times)
Google dot what?
*
Posts: 2
16 credits
Members referred : 0


« on: Aug 30, 2006, 11:12:39 PM »

I am an intermediate PHP MySql user and have a few applications under my belt - But nothing as sophisticated as the access software I downloaded from here.

I *ONLY* wish to run the sample scripts, so I have to install it as the defaults expect.. But I don't know how.


In the db_config.php file I have:

// 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 = "/home/mywebsite/public_html/access_user_class/"; // a second location where the scripts should be
define("APPLICATION_PATH", $sec_path);



I know this is way off but I don't know what the author means by the "/classes/" directory or "second location?   Am I supposed to MKDIR one?  where?

 What does he mean when he says some files need to be "ABOVE the DOCUMENTROOT?   Like in the /home/ directory??   My DOCUMENT _ROOT is (I presume) /home/mywebsite/public_html/

All I get when running login.php or example.php is a white screen.

PLEASE help, somebody.  I'm better off SEEING a sample dir structure from a linux OS...  Can someone show me what this is suppossed to look like?


Helping me grasp this will be great karma for you - I'm  desperate
« Last Edit: Aug 30, 2006, 11:28:49 PM by GaryM »
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6439
39458 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: Aug 30, 2006, 11:58:56 PM »

hello,

start with placing all files in this structure:

root/classes/access_user/

the constants above are based on this setting...


Last blog : Just a better Internet portal provided by Google
Google dot what?
*
Posts: 2
16 credits
Members referred : 0


« Reply #2 on: Aug 31, 2006, 01:32:35 AM »

I see what I'm doing wrong.  Thank you.

I'm a bit dyslexic.    I set up the files in /home/mywebsite/public_html/access_user/classes/...

access_user and classes were swapped.

« Last Edit: Aug 31, 2006, 02:19:42 AM by GaryM »
Atari ST fan
*
Posts: 8
52 credits
Members referred : 0



« Reply #3 on: Oct 03, 2006, 06:29:30 AM »

I see what I'm doing wrong.  Thank you.
Hi there,

I'm new to webdigity and AU both. I love the concept (and existence) of the AU script, and I'm glad you figured out your path situation, but I'm still a bit confused. But then, I might be reading too much into this.

I believe your request for a directory structure is good. I would love to have one too.

I'm also confused as to why there is a "CLASS_PATH" and a "APPLICATION_PATH". I'm thinking that the brains of the application should be stored away from where the application is using it. I also read that as being "above your document root", which to me means "/home/domain/classes/", and not "/home/domain/public_html/classes/". I especially prefer to keep my sensitive variables outside the browser area.

Then there's the admin files, which I would think should be directory protected.

All that in mind, I'm seeing a directory structure such as this:

/home/domain/configs/classes/access_user_class/
... db_config.php
... access_user_class.php [renamed to something else]
... session_handler.php

/home/domain/public_html/myapp/
... example.php
... login.php
... logout.php
... register.php
... forgot_password.php
... update_user_profile.php
... update_user.php

/home/domain/public_html/myapp/admin/ [dir protected]
... admin_user.php
... login.php
... test_access_level.php (not sure what this is yet)

Haven't figured out or looked at yet:
... activate_password.php
... deny_access.php
... ext_user_profile.php
... login_local.php

These are just document files for installation and use, correct?
... testpage.php
... access_user_doc.htm
... access_user_profile_doc.htm

Now I'm sure there are 50 ways to set this up, but please let me know if my structure here has something to be desired, and especially if some of my files are out of place.

My biggest concern is, when I separated out the admin file, it required the login file. So, I'm wondering if I need to replicate the files in the myapp folder, but then it would still use the same db_config, so I'm not sure of the ramifications of that.

Thanks for your ear.
« Last Edit: Oct 03, 2006, 06:45:00 AM by KDCinfo »
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6439
39458 credits
Members referred : 374


It's time to use PHP5!


« Reply #4 on: Oct 03, 2006, 08:28:46 AM »

Hi,

I work most of the time with three directories:

1 for the class
1 for admin
1 for the application

the only important path is the application path because this one is used in the email message.

all other pathes are just a matter of a right using of th include/require commands

Edit but start with that structure and tell us the settings from you config file.


Last blog : Just a better Internet portal provided by Google
Atari ST fan
*
Posts: 8
52 credits
Members referred : 0



« Reply #5 on: Oct 03, 2006, 08:57:45 AM »

Hi,

I work most of the time with three directories:

1 for the class
1 for admin
1 for the application

the only important path is the application path because this one is used in the email message.

all other pathes are just a matter of a right using of th include/require commands

Edit but start with that structure and tell us the settings from you config file.
So it sounds like I'm on the right path Smiley Thanks.

My config path settings are:

$cls_path = dirname($_SERVER['PHP_SELF'])."/";
$sec_path = dirname($_SERVER['PHP_SELF'])."/useraccess/"; // dir protected
define("CLASS_PATH", $cls_path); // the location where the class is executed
define("APPLICATION_PATH", $sec_path);

But, I manually overwrote any file that's looking for "db_config.php", "access_user_class.php", or "session_handler.php" and pointed them to:
/home/domain/classes/access_user_class/ [although mine are a bit renamed]

Seems to work on initial try, but wasn't certain about the remaining files. I'll keep reading your online help and doc files, and play around with it some more. Right now I think its more than what I was originally looking for, but its also evident that I'm going to grow right into it. You've done great stuff here! Smiley

Thanks.
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=3901
Tags : php mysql webdigity browsers linux Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: Please explain the directory structure for this class
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Nov 22, 2008, 05:17:22 AM





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!


Forum Statistics
Total Posts: 37.733
Total Topics: 7.649
Total Members: 4.393
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: 2bi4ll5

40 Guests, 5 Users online :

16 users online today:



Readers

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