/    Sign up×
Community /Pin to ProfileBookmark

keeping a csv.txt file safe

Hi guys/gals quick question. Im have a php form which when submitted enters all the entries into a csv.txt file.

My question is this csv file should only be visible by admins.. at the moment anyone who broswes to [url]www.mydomain.com/csv.txt[/url] would be able to view this csv file.

How can I prevent this from happening? Cheers in adavnce for your help

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@NogDogNov 07.2005 — One thing you can do is put the CSV file in a directory which is not within the public HTML directories. For instance, on a UNIX/Linux system, you might have your PHP page in the /srv/www/htdocs/ directory area (which is the document root for HTTP requests), but you could have the CSV file in a /home/yourname/CSV/ directory. (You will need to ensure that the user under which the webserver runs the PHP script will have read (and write if needed) access to the CSV directory and file.)
×

Success!

Help @chelnov63 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...