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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    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


  • Andy Hassall

    #2
    Re: fppen------ How do I get permission to write to a html file?

    On Fri, 14 Jan 2005 20:59:12 -0000, "John" <john@al3home20 03.freeserve.co .uk>
    wrote:
    [color=blue]
    >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?[/color]

    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 / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
    <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

    Comment

    • Alvaro G. Vicario

      #3
      Re: fppen------ How do I get permission to write to a html file?

      *** John escribió/wrote (Fri, 14 Jan 2005 20:59:12 -0000):[color=blue]
      > How do I get permission to write to a html file?[/color]

      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
      --

      Comment

      • John

        #4
        fopen------ How do I get permission to write to a html file?

        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


        Comment

        • Alvaro G. Vicario

          #5
          Re: fopen------ How do I get permission to write to a html file?

          *** John escribió/wrote (Sat, 15 Jan 2005 10:04:58 -0000):[color=blue]
          > 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.[/color]

          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
          --

          Comment

          • John

            #6
            Re: fopen------ How do I get permission to write to a html file?

            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" <john@al3home20 03.freeserve.co .uk> wrote in message
            news:csatcl$ut8 $1@newsg1.svr.p ol.co.uk...[color=blue]
            > 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[/color]
            DON'T[color=blue]
            > 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[/color]
            c:\Inetpub\wwwr oot\php\TMP21iw eacr8t.php[color=blue]
            > on line 61
            >
            > The TMP file is produced from inside D.MX but I get the same error[/color]
            if[color=blue]
            > I go via the browser and D.MX is shut down.
            >
            >
            >
            > There doesn't seem to be any visible difference to the attributes[/color]
            for[color=blue]
            > 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
            >
            >[/color]


            Comment

            • Alvaro G. Vicario

              #7
              Re: fopen------ How do I get permission to write to a html file?

              *** John escribió/wrote (Sat, 15 Jan 2005 12:25:46 -0000):[color=blue]
              > yes it is NTFS.[/color]

              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
              --

              Comment

              • John

                #8
                Re: fopen------ How do I get permission to write to a html file?

                You are right. Thank you sir!

                "Alvaro G. Vicario" <kAlvaroNOSPAMT HANKS@terra.es> wrote in message
                news:1dfmvfi6lx rqq$.1btltqmnue dhy$.dlg@40tude .net...[color=blue]
                > *** John escribió/wrote (Sat, 15 Jan 2005 12:25:46 -0000):[color=green]
                > > yes it is NTFS.[/color]
                >
                > Then you probably have the "Use simple file sharing" option set in[/color]
                "Folder[color=blue]
                > options" (name may differ, I'm translating from Spanish). Despite[/color]
                its name,[color=blue]
                > that option makes file permission handling rather complicate.
                >
                >
                >
                > --
                > -+ Álvaro G. Vicario - Burgos, Spain
                > +- http://www.demogracia.com (la web de humor barnizada para la[/color]
                intemperie)[color=blue]
                > ++ Las dudas informáticas recibidas por correo irán directas a la[/color]
                papelera[color=blue]
                > -+ I'm not a free help desk, please don't e-mail me your questions
                > --[/color]


                Comment

                Working...