Results 1 to 2 of 2

Thread: creating a file in a directory without everyone permissions

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2006
    Posts
    147

    creating a file in a directory without everyone permissions

    $File = sitemap.xml";
    $Handle = fopen($File, 'w');
    $Data="first line \n";
    fwrite($Handle, $Data);
    fclose($Handle);

    the problem is it wont create the file unless the directory has everyone on write permissions

    i dont want to put that permission in place mainly because this file needs to be created in the root of the website folder. how would i go about creating a file and putting it in the root of a website withouth changing the permissions. the php script that im using is also on the server under my admin tools.

    thanks
    -JLR

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: creating a file in a directory without everyone permissions

    You don't need to give everyone permission; you need to give the webserver permission. And there's absolutely no way around that.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width