By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,438 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

fppen------ How do I get permission to write to a html file?

P: n/a
I can write to this textfile:

$fp = fopen("./testfile.txt","w");

but not this html file:

$fp = fopen("./testfile.html","w");

How do I get permission to write to a html file?

Windows XP, IIS localhost

Thanks
Jul 17 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
On Fri, 14 Jan 2005 20:59:12 -0000, "John" <jo**@al3home2003.freeserve.co.uk>
wrote:
I can write to this textfile:

$fp = fopen("./testfile.txt","w");

but not this html file:

$fp = fopen("./testfile.html","w");

How do I get permission to write to a html file?


Just change the permissions on testfile.html to match those of testfile.txt;
it's not a function of the extension.

What error do you get anyway? Are you sure it's a permissions problem?

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2

P: n/a
*** John escribió/wrote (Fri, 14 Jan 2005 20:59:12 -0000):
How do I get permission to write to a html file?


Open explorer, find the file, right click on it, Properties, Security. You
can previously write down what permission you have in the file you can
edit.

In any case, it's far better to create a separate folder for files that
should be publicly writeable.

--
-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie)
++ Las dudas informáticas recibidas por correo irán directas a la papelera
-+ I'm not a free help desk, please don't e-mail me your questions
--
Jul 17 '05 #3

P: n/a
Thanks for your inputs - inspiration for more experiments.

I now find I can open and write to a .html file ok as long as I DON'T
create it or edit it with Dreamweaver MX.

The error displayed is:
Warning: fopen(./testfile.html) [function.fopen]: failed to open
stream: Permission denied in c:\Inetpub\wwwroot\php\TMP21iweacr8t.php
on line 61

The TMP file is produced from inside D.MX but I get the same error if
I go via the browser and D.MX is shut down.

There doesn't seem to be any visible difference to the attributes for
either file opened in the php code or created with D.MX

btw, I don't seem to get the "Security" tab that everyone's talking
about.
(XP Proffessional). In "properties" I get 4 tags: General, Sharing,
Web Sharing, Cusomize. But I'll deal with that elsewhere - it's not
exactly PHP...

Thanks
Jul 17 '05 #4

P: n/a
*** John escribió/wrote (Sat, 15 Jan 2005 10:04:58 -0000):
btw, I don't seem to get the "Security" tab that everyone's talking
about.
(XP Proffessional). In "properties" I get 4 tags: General, Sharing,
Web Sharing, Cusomize.


Is it an NTFS partition? FAT32 doesn't allow to restrict access to files.
BTW, you shouldn't open a new thread taking for granted everyone knows what
you're talking about ;-)
--
-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie)
++ Las dudas informáticas recibidas por correo irán directas a la papelera
-+ I'm not a free help desk, please don't e-mail me your questions
--
Jul 17 '05 #5

P: n/a
yes it is NTFS.
It's strange that in properties of a directory I can alter the option
button which is set at "Read-only" and click "Apply" or "OK", but when
I come back it's set at "Read-only" again. I thought the reason was
that you can't write to a directory anyway, but I don't know why it
goes through the motions.

Sorry about the new thread.
Also OE puts the original message at the end...

"John" <jo**@al3home2003.freeserve.co.uk> wrote in message
news:cs**********@newsg1.svr.pol.co.uk...
Thanks for your inputs - inspiration for more experiments.

I now find I can open and write to a .html file ok as long as I DON'T create it or edit it with Dreamweaver MX.

The error displayed is:
Warning: fopen(./testfile.html) [function.fopen]: failed to open
stream: Permission denied in c:\Inetpub\wwwroot\php\TMP21iweacr8t.php on line 61

The TMP file is produced from inside D.MX but I get the same error if I go via the browser and D.MX is shut down.

There doesn't seem to be any visible difference to the attributes for either file opened in the php code or created with D.MX

btw, I don't seem to get the "Security" tab that everyone's talking
about.
(XP Proffessional). In "properties" I get 4 tags: General, Sharing,
Web Sharing, Cusomize. But I'll deal with that elsewhere - it's not
exactly PHP...

Thanks

Jul 17 '05 #6

P: n/a
*** John escribió/wrote (Sat, 15 Jan 2005 12:25:46 -0000):
yes it is NTFS.


Then you probably have the "Use simple file sharing" option set in "Folder
options" (name may differ, I'm translating from Spanish). Despite its name,
that option makes file permission handling rather complicate.

--
-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie)
++ Las dudas informáticas recibidas por correo irán directas a la papelera
-+ I'm not a free help desk, please don't e-mail me your questions
--
Jul 17 '05 #7

P: n/a
You are right. Thank you sir!

"Alvaro G. Vicario" <kA*****************@terra.es> wrote in message
news:1d*******************************@40tude.net. ..
*** John escribió/wrote (Sat, 15 Jan 2005 12:25:46 -0000):
yes it is NTFS.
Then you probably have the "Use simple file sharing" option set in

"Folder options" (name may differ, I'm translating from Spanish). Despite its name, that option makes file permission handling rather complicate.

--
-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie) ++ Las dudas informáticas recibidas por correo irán directas a la papelera -+ I'm not a free help desk, please don't e-mail me your questions
--

Jul 17 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.