File permissions for writing to files with PHP

Security issues related to php and mysql usage. How to make your code secure? Security measures and configurations? It's all in here!

Moderators: macek, egami, gesf

ciridian
New php-forum User
New php-forum User
Posts: 1
Joined: Mon Oct 20, 2008 1:37 am

File permissions for writing to files with PHP

Postby ciridian » Mon Oct 20, 2008 1:43 am

Hello all,

I have created a script to edit html pages in PHP, so customers can edit the text on their website themselves. I have only one problem with the script though: the files which are edited need to have a chmod permission of 777. Thus, all the .html files need that permission before my script works. My question is: is it dangerous to set the permission to 777 on files which are accessible by the visitors of a website?
If it is, is there a way to temporarily give a file the new permissions before turning them back to normal?
Thanks in advance,

Ciridian Islanzadí.

Suhoij
New php-forum User
New php-forum User
Posts: 92
Joined: Tue Aug 17, 2010 2:00 am
Location: Ukraine Kharkov
Contact:

Re: File permissions for writing to files with PHP

Postby Suhoij » Tue Aug 17, 2010 5:32 am

Try to change permissions by the script before changing info - User click "edit" -script changing permissions to 777 , user editing the file after that he click "save" and script change it to 666. Isn't better to use database?


Return to “PHP & MySQL Security”

Who is online

Users browsing this forum: No registered users and 1 guest

cron