Writing to a File with PHP. Permissions?

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

User avatar
imroue
New php-forum User
New php-forum User
Posts: 62
Joined: Fri Oct 11, 2002 6:53 am
Contact:

Writing to a File with PHP. Permissions?

Postby imroue » Tue Nov 19, 2002 7:18 am

When I try to write to a file I get this message:

Warning: fopen("gb.dat", "a") - Permission denied in x:\Web\OurSite\GuestBook\ardguest.php on line 567

This sounds like a simple fix with permissions. But I am not sure how to do this with IIS in Windows XP. Or is IIS the problem?
------------------------
after installing mailtraq

This is another message I get:
Warning: Failed to Receive in E:\Web\OurSite\guestbook\ardguest.php on line 583

Warning: Cannot add header information - headers already sent by (output started at E:\Web\OurSite\guestbook\ardguest.php:583) in E:\Web\OurSite\guestbook\ardguest.php on line 589

User avatar
Joan Garnet
Moderator
Moderator
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars
Contact:

Postby Joan Garnet » Thu Nov 21, 2002 5:11 am

Go to your server vua ftp, select the file where the script is and then right click on it.
Change permissions to 777 which means that you give users full permissions (this is dangerous in some cases)

:)

User avatar
imroue
New php-forum User
New php-forum User
Posts: 62
Joined: Fri Oct 11, 2002 6:53 am
Contact:

Postby imroue » Thu Nov 21, 2002 11:48 am

Joan Garnet wrote:Go to your server vua ftp, select the file where the script is and then right click on it.
Change permissions to 777 which means that you give users full permissions (this is dangerous in some cases)

:)


I use windows XP. Can't I do it within the file itself?
What settings are safe for the script to at least work.?

User avatar
Joan Garnet
Moderator
Moderator
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars
Contact:

Postby Joan Garnet » Thu Nov 21, 2002 3:31 pm

Yes, you can proceed the same way:
right click the file and go to security options, then select all permissions.
That's it
:)


Return to “PHP coding => General”

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests