User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 425,983 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,639 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1863 | Replies: 6 | Solved
Reply
Join Date: Feb 2005
Posts: 9
Reputation: 1andyw is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
1andyw 1andyw is offline Offline
Newbie Poster

'Private' directory practical use

  #1  
Mar 11th, 2005
My isp web server is separated into ‘www’, which parses php, html, etc; and ‘private’ which does not parse. What are the practical limitations of placing files in the private section.

I am setting up a content management system for off campus work.

Anyone know of a decent tutorial or article explaining this?

Thanks,

Andy
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation: Comatose is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 108
Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Moderator

Re: 'Private' directory practical use

  #2  
Mar 11th, 2005
Well, I'm not sure who you are using, or anything... but with an educated guess, your ISP offers you web space, and anything in that directory (www) is going to be accessible (given permissions are set correctly) to anyone on the web. This would be your web page, your asp files, any downloads and zips, pictures etc, etc. But maybe, you'd like to keep some stuff off the web, that you'd still like to keep stored on their server. Maybe Old web content that you don't want anyone to have access to. I know I have some rather ugly pics of myself, that I would never put in a www
Reply With Quote  
Join Date: Feb 2005
Posts: 9
Reputation: 1andyw is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
1andyw 1andyw is offline Offline
Newbie Poster

Re: 'Private' directory practical use

  #3  
Mar 11th, 2005
Hi,

I see what you mean. Thanks for the input.

Andy
Reply With Quote  
Join Date: Oct 2004
Location: San Francisco, CA
Posts: 338
Reputation: paradox814 is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 2
paradox814's Avatar
paradox814 paradox814 is offline Offline
Posting Whiz

Re: 'Private' directory practical use

  #4  
Mar 11th, 2005
the other thing you could do with the private section is restrict downloads. Suppose you only want to let your members download certain videos from your website (or any other content) then you can keep the file stored in the private section and then just parse it out to those members who are properly logged in with the correct permissions.
Reply With Quote  
Join Date: Feb 2005
Posts: 9
Reputation: 1andyw is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
1andyw 1andyw is offline Offline
Newbie Poster

Re: 'Private' directory practical use

  #5  
Mar 11th, 2005
Paradox,

Your ideas are sound.

I have been placing password and other text files 'off site' and it works great. However, when I placed 'include' functions 'off site' I ran into issues referencing other files from the included functions. That is why I need to educate myself on the advantages and limitations of this practice.

I have a bookshelf full of reference material, but this subject is not covered in a way that I can grasp the details.

Thanks,

Andy
Reply With Quote  
Join Date: Oct 2004
Location: San Francisco, CA
Posts: 338
Reputation: paradox814 is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 2
paradox814's Avatar
paradox814 paradox814 is offline Offline
Posting Whiz

Re: 'Private' directory practical use

  #6  
Mar 12th, 2005
yes I think that PHP does support some ftp functions (i have no idea how to use those) so that you could log into another off site server and access these files, although this would probably be too time consuming if you did this on every single webpage on your site.

On the other hand you could always set up a cron job to copy the files from the offsite server every hour or so to the server you are working on to make sure it always has a some what fresh copy.
Reply With Quote  
Join Date: Jul 2008
Posts: 1
Reputation: alphaseinor is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
alphaseinor alphaseinor is offline Offline
Newbie Poster

Re: 'Private' directory practical use

  #7  
Jul 6th, 2008
Most of the time the "private" directory on a web server is where you would store your login information to a database or other sensitive information. Drawbacks include if someone gets access to your website (control panel, or FTP) and can see things outside of your http. If the DB account has more than just select access on a few meaningless tables (read... menus, content, etc.) then you can most likely just put it into your normal www directory.

about 80% of the time they are accessed by other php scripts (internal to your site) using this:
require("home/webname/private/file.php");

I personally like to put in a connection.php file that holds all of the information to the database (host, username, password, etc). I also like to hold my security check for the host there as well... which looks something like this:

if (($_SERVER['SERVER_NAME']!="your host name")){
	 echo "you are not authorized to access this page"; 
	die(); 
} 

you can always get your host name by using
echo $_SERVER['SERVER_NAME'];

remember that a lot of ISPs are now using something like localhost:temp/mysql5.sock file for a little added security on your DB. just check with your ISP and they'll let you know.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 11:40 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC