home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

Deny WWW access to file

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 1516
Discussions: 200,926, Posts: 2,379,129, Members: 246,292
Old August 8th, 2006, 03:31 PM   Digg it!   #1 (permalink)
Ultimate Member
 
FatalException's Avatar
 
Join Date: Jun 2004
Location: Indianapolis, Indiana
Posts: 1,398
Deny WWW access to file

Is there a way to limit access to a specific file through my web server? I'm currently designing a blog-style website and in order to update it, the user must - of course - enter a password. The password is stored in a file elsewhere on the server, and is included into the program via a include(); function call in PHP. The problem is that when I go to the directory where the password file is via a web-browser, the content of the file shows up; in plain-text, with the password readily visible! I have full access to the server (root) so permission changing and such is not a problem. I've tried changing permissions on the file to 400, 440, and 444. Only the last one works; so obviously global read is needed for some reason. But, when it's 444, it can also be viewed via a web browser. Is there a way to change my htaccess files or something to prohibit www access to this file, but allow locally-running PHP scripts access to the file?
__________________
Logic shall prevail.
FatalException is offline   Reply With Quote
Old August 8th, 2006, 04:13 PM     #2 (permalink)
Super F@D Folder
 
Join Date: Jun 2004
Posts: 5,083
Send a message via AIM to sr71000
apache??

why not just move the password file out of the directory you're serving? If you don't want the web to have access to it, put in somewhere on the server that isn't served to the web! php can access anywhere in your machine as it's a script running on your computer.

Last edited by sr71000 : August 8th, 2006 at 04:18 PM.
sr71000 is offline   Reply With Quote
Old August 8th, 2006, 07:41 PM     #3 (permalink)
Member
 
drizzle's Avatar
 
Join Date: Oct 2001
Location: Louisiana, USA
Posts: 256
Send a message via MSN to drizzle
Your password is nested between PHP tags and it's being printed to the screen? That shouldn't be happening. Add them to the file to fix that. Following sr71000's advice isn't a bad idea either.

PHP Code:
<?php

$mypassword 
"ef0q349df";

?>
drizzle is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
Remote access to file? kenboyles72 Networking and Internet 3 March 16th, 2006 02:30 AM
WinXP Folder and File Access ShizzleMacDaddy Technical Support 5 August 2nd, 2005 11:23 PM
www.googlegear.com changed name to www.zipzoomfly.com baskarans General Discussion and Buyer Guidance 18 September 20th, 2003 04:29 AM
ICS deny access to one computer skuz Networking and Internet 10 September 9th, 2002 07:58 AM
how do i deny access? dar1again Networking and Internet 12 May 25th, 2002 02:11 AM


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Is It Just Me? (2865)
Obama the Muslim (14)
Is the PSU I received dead? (10)
windows vista security holes (9)
HIS HD5770 graphic card question (15)
Foreign voltage (10)
Install XP pro and a Vista laptop ?.. (10)
Print spooler problem (13)
Dept. of HS: NSA 'Helped' Develop V.. (15)
A good PSU? (10)
Ideal cheap graph card for PC-Gamin.. (15)
New Computer wont recognize XP disc (7)
EVGA 9800 gtx help with finding a g.. (8)
World's largest Monopoly Game using.. (331)
Recent Discussions
Regular Build (0)
Modern Warfare For the PC (33)
radeon x850xt platinum & shader 3 (3)
Have you switched yet? (84)
Install XP pro and a Vista laptop ?? (10)
Wireless Router+Cable Modems and Much.. (0)
Optical Audio A-B Switch (1)
windows vista security holes (9)
Fire in DVD (0)
The NTDVM CPU has encountered an ille.. (24)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (34)
Wireless speakers for PC? (11)
Print spooler problem (13)
Help getting around port 80 for camer.. (2)
Display shows 3x5 inch in middle of s.. (3)
monitor will not turn on at all, (1)
World's largest Monopoly Game using G.. (331)
Foreign voltage (10)
FiOS modem/router interfering with ne.. (7)
Browsers wont load websites (2)
Virus Doctor Popup? (1)
Dept. of HS: NSA 'Helped' Develop Vis.. (15)
EVGA 9800 gtx help with finding a goo.. (8)
Problem with speed step/turbo boost? (1)
Modern Warfare 2: Who Bought It? (61)


All times are GMT -4. The time now is 01:27 AM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28