PHP Guest Book, CHMODing/file permissions question


i'm not of programmer, i'm working on guest book wedding website sister. right form users fill out post guest book has 3 fields - "name", "email", , message. store these values in single text file, read when display them on front end of guest book.

problem don't display email addresses, want them available in 'administration panel' sister's convenience.

use standard fopen access file, convert data html. i've found fopen doesn't work @ unless 'public' set 'read' in chmod (777 example). when data file chmod'd 777 internet connection can access files directing url text file. natural thought process (knowing little chmoding) make permissions 666, give 'owner' (who assume me , files on server) access data file, 'public' denied access. sure enough, when chmod 666, desired "403 forbidden", script can't access file read data. it's if file thinks script 'public' script.

hope made tiny bit of sense other myself. don't know i'm talking makes hard describe situation :).

appreciated, thank ahead of time!

e
 

php's fopen() depends on ability of web server read file. apache runs user/group - www/www. if user/group can't read particular file, won't able serve it, , fopen() won't work on it.

take different approach protecting file. create .htaccess ensure not read. such as:

<files sensitive-email-addys.txt>
deny all
</files>

web browsers won't able see it, web server still able write it.

way, 666 rw-rw-rw-, 777 rwxrwxrwx. both dangerous permissions public file on webserver because theoretically allow write file.
 


Forums Special Interests Web Design and Development


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

Comments

Popular posts from this blog

Currys UK online order nightmare!

Mini-DVI to DVI-I?

New iMac here - LOVING the Mighty Mouse