473,772 Members | 2,965 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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
7 2204
On Fri, 14 Jan 2005 20:59:12 -0000, "John" <jo**@al3home20 03.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.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2
*** 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
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\wwwr oot\php\TMP21iw eacr8t.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
*** 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
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**@al3home20 03.freeserve.co .uk> wrote in message
news:cs******** **@newsg1.svr.p ol.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\wwwr oot\php\TMP21iw eacr8t.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
*** 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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
875
by: Hai Nguyen | last post by:
Hi all I'm coding a Web application which requires to write an XML file into a folder. I'm wondering other than account Everyone which else I can set permission so that my application can have the rights to write the file.
9
2958
by: Jay Kim | last post by:
Hi, We're implementing a Windows application using Visual Basic .NET. One of the key features we need to implement is that we should be able to get the accurate byte offset of user selected text in the file. We've been trying to use the RichTextBox control to load
2
4907
by: ykgoh | last post by:
Hi. I've a problem of being able to create and remove a directory but unable to write a file inside the created directory for some strange reason. I suspect that this problem could be vaguely linked to Safe mode being set to On since my site is using shared server hosting and probably insufficient/incorrect Unix file permission. Below is my test script that helps me narrow down the problem....
3
7965
by: David Thielen | last post by:
Hi; I created a virtual directory in IIS 6.0 and my asp.net app runs fine. But when it tries to write a file I get: Access to the path is denied. - C:\Inetpub\wwwroot\RunReportASP\images C:\Inetpub\wwwroot\RunReportASP is the directory of my virtual directory for my app. In it's properties I did check "Write" as a permission. What else do I need to do?
9
4382
by: Niron kag | last post by:
Hello ! With c# , I want to create a HTML file programatically . How can I do it ? Thank U !
2
7701
by: Bina | last post by:
hi, I want to read & write a html file which contain the japanese character. Now how i will do it?I can read & write english character . but when i read & write Japanese character from the html file then the writed html file cannnot show the japanese character. my new created html file show the another character, it cannot show the original japanese character. But when i read & write data from a txt file it works. But only problem is,When...
8
12905
by: jld730 | last post by:
I have been given a snippet of HTML code that I am to use Python to write it out. I am somewhat new to Python, and completely new to HTML, so I'm still unclear on what it is I am supposed to be doing. So please bear with me as I try to figure this out as I go. But first, just starting out, outputting the first line of the HTML already has me lost with all the competing quotes/unquotes. How do I write out this first line using Python? ...
6
2336
by: Thanh-Nhan Le | last post by:
Hello, I have an ASP application on IIS server: http://localhost/myApp I use ASP and a my own VB activex DLL to create a pdf file and write this file to a subfolder of the Application folder: http://localhost/myApp/pdfs 1- Over IIS I have set the "write permission" for this subfolder.
6
2547
by: Shawn | last post by:
Hello: I have the following code in a PHP file. An HTML form passes user comment data to the PHP, which then appends the user comments to the end of the HTML file on which the form is located. This PHP code works: the HTML file with added comments displays correctly in my browser. However, appending text to the very end of the HTML file creates what is, strictly speaking, invalid code. I am looking for a way to tell PHP to write data to...
0
9620
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9912
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8934
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.