protection

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

saurabh
Forum Newbie
Posts: 13
Joined: Fri Jun 14, 2002 5:43 am
Location: India
Contact:

Post by saurabh »

e+ wrote:If you are having trouble writing to the flatfile you might want to check the CHMOD of the file you will probably need to set it to 777. This is normally a bad thing to do but if the file is protected by being in a secure directory you should be ok. Once you have changed the CHMOD you should be able to access the file with scripts on your server without any difficulty.
Hi,
Well i have written a php script that reads and modifies a flat file and all is working. I just want the flat file to be kept secured. It should be kept in a folder that no one is able to access. So how abt that. Once u told me to modify htaccess file like using <Limit Get> and so on. i did it and it worked little bit. The problem was that it wasnt opening any gif files andaccess to other file was denied. so by modifying that file is it possible or some other way.

I am thankful for your help but still i m stuggling. any help.

Thanks,
Saurabh
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

I appreciate that you feel a folder has to have a password in order to be secure but have you considered my option of having the flat file stored in a folder that is parallel to the root folder of the website. Doing it that way would mean that it would not be possible to access the file via the URL.

But anyway, when you set up the secured folder did you only put the flat file in it? The impression I got was that you not only put the flat file in but other files as well such as pictures and the PHP script needed to run the file write. Basically, don't do that. Those files should be kept in an unsecured folder not the secured one. Only the flat file should go in the secured folder otherwise, as you found, you can't access the pictures or the script.

Mac
saurabh
Forum Newbie
Posts: 13
Joined: Fri Jun 14, 2002 5:43 am
Location: India
Contact:

re: protection

Post by saurabh »

twigletmac wrote:I appreciate that you feel a folder has to have a password in order to be secure but have you considered my option of having the flat file stored in a folder that is parallel to the root folder of the website. Doing it that way would mean that it would not be possible to access the file via the URL.

But anyway, when you set up the secured folder did you only put the flat file in it? The impression I got was that you not only put the flat file in but other files as well such as pictures and the PHP script needed to run the file write. Basically, don't do that. Those files should be kept in an unsecured folder not the secured one. Only the flat file should go in the secured folder otherwise, as you found, you can't access the pictures or the script.

Mac
Hi pal,

Well you want to say that i should put the php files and gif images in unsecured folder and only the flat file which my php script processes and i want secure in a protected folder. One option you gave is putting them in folder paralled to root folder. Thats fine otherwise if i create a normal folder and protect it then how will my php script access that flat file. Will any password box popup (which ofcourse i dont want) or what changes will i have to make???

i am thankful to you for your help.

Thanks,
Saurabh
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Umm, have you tried putting the flat-file in the protected folder and accessing it from your PHP script (not in the protected folder) - you may answer your own question then.

Mac
saurabh
Forum Newbie
Posts: 13
Joined: Fri Jun 14, 2002 5:43 am
Location: India
Contact:

Post by saurabh »

twigletmac wrote:Umm, have you tried putting the flat-file in the protected folder and accessing it from your PHP script (not in the protected folder) - you may answer your own question then.

Mac
Thanks for your support. I was able to complete my task. I put the flat file in protected folder and script in non protected folder and it worked. Thanks.
Post Reply